
from blazar.plugins import base


class DummyVMPlugin(base.BasePlugin):
    """Plugin for VM resource that does nothing."""
    resource_type = 'virtual:instance'
    title = 'Dummy VM Plugin'
    description = 'This plugin does nothing.'

    def reserve_resource(self, reservation_id, values):
        return None

    def on_start(self, resource_id):
        """Dummy VM plugin does nothing."""
        return 'VM %s should be waked up this moment.' % resource_id

    def on_end(self, resource_id):
        """Dummy VM plugin does nothing."""
        return 'VM %s should be deleted this moment.' % resource_id


from blazar.plugins import base


class DummyVMPlugin(base.BasePlugin):
    """Plugin for VM resource that does nothing."""
    resource_type = 'virtual:instance'
    title = 'Dummy VM Plugin'
    description = 'This plugin does nothing.'

    def reserve_resource(self, reservation_id, values):
        return None

    def update_reservation(self, reservation_id, values):
        return None

    def on_start(self, resource_id):
        """Dummy VM plugin does nothing."""
        return 'VM %s should be waked up this moment.' % resource_id

    def on_end(self, resource_id):
        """Dummy VM plugin does nothing."""
        return 'VM %s should be deleted this moment.' % resource_id

Add update_reservation to dummy plugin
Add update_reservation to dummy plugin

update_reservation is now an abstract method. It needs to be added to
all plugins.

Change-Id: I921878bd5233613b804b17813af1aac5bdfed9e7

  
  from blazar.plugins import base
  
  
  class DummyVMPlugin(base.BasePlugin):
      """Plugin for VM resource that does nothing."""
      resource_type = 'virtual:instance'
      title = 'Dummy VM Plugin'
      description = 'This plugin does nothing.'
  
      def reserve_resource(self, reservation_id, values):
          return None
  
+     def update_reservation(self, reservation_id, values):
+         return None
+ 
      def on_start(self, resource_id):
          """Dummy VM plugin does nothing."""
          return 'VM %s should be waked up this moment.' % resource_id
  
      def on_end(self, resource_id):
          """Dummy VM plugin does nothing."""
          return 'VM %s should be deleted this moment.' % resource_id
  
Add update_reservation to dummy plugin
## Code Before:

from blazar.plugins import base


class DummyVMPlugin(base.BasePlugin):
    """Plugin for VM resource that does nothing."""
    resource_type = 'virtual:instance'
    title = 'Dummy VM Plugin'
    description = 'This plugin does nothing.'

    def reserve_resource(self, reservation_id, values):
        return None

    def on_start(self, resource_id):
        """Dummy VM plugin does nothing."""
        return 'VM %s should be waked up this moment.' % resource_id

    def on_end(self, resource_id):
        """Dummy VM plugin does nothing."""
        return 'VM %s should be deleted this moment.' % resource_id

## Instruction:
Add update_reservation to dummy plugin
## Code After:

from blazar.plugins import base


class DummyVMPlugin(base.BasePlugin):
    """Plugin for VM resource that does nothing."""
    resource_type = 'virtual:instance'
    title = 'Dummy VM Plugin'
    description = 'This plugin does nothing.'

    def reserve_resource(self, reservation_id, values):
        return None

    def update_reservation(self, reservation_id, values):
        return None

    def on_start(self, resource_id):
        """Dummy VM plugin does nothing."""
        return 'VM %s should be waked up this moment.' % resource_id

    def on_end(self, resource_id):
        """Dummy VM plugin does nothing."""
        return 'VM %s should be deleted this moment.' % resource_id
