
import os
import sys
import xapi
import xapi.plugin
from xapi.storage.datapath import log


class Implementation(xapi.plugin.Plugin_skeleton):

    def query(self, dbg):
        return {
            "plugin": "loopdev+blkback",
            "name": "The loopdev+blkback kernel-space datapath plugin",
            "description": ("This plugin manages and configures loop"
                            " devices which can be connected to VMs"
                            " directly via kernel-space blkback"),
            "vendor": "Citrix",
            "copyright": "(C) 2015 Citrix Inc",
            "version": "3.0",
            "required_api_version": "3.0",
            "features": [
            ],
            "configuration": {},
            "required_cluster_stack": []}

if __name__ == "__main__":
    log.log_call_argv()
    cmd = xapi.plugin.Plugin_commandline(Implementation())
    base = os.path.basename(sys.argv[0])
    if base == "Plugin.Query":
        cmd.query()
    else:
        raise xapi.plugin.Unimplemented(base)


import os
import sys
import xapi
import xapi.storage.api.plugin
from xapi.storage import log


class Implementation(xapi.storage.api.plugin.Plugin_skeleton):

    def query(self, dbg):
        return {
            "plugin": "loopdev+blkback",
            "name": "The loopdev+blkback kernel-space datapath plugin",
            "description": ("This plugin manages and configures loop"
                            " devices which can be connected to VMs"
                            " directly via kernel-space blkback"),
            "vendor": "Citrix",
            "copyright": "(C) 2015 Citrix Inc",
            "version": "3.0",
            "required_api_version": "3.0",
            "features": [
            ],
            "configuration": {},
            "required_cluster_stack": []}

if __name__ == "__main__":
    log.log_call_argv()
    cmd = xapi.storage.api.plugin.Plugin_commandline(Implementation())
    base = os.path.basename(sys.argv[0])
    if base == "Plugin.Query":
        cmd.query()
    else:
        raise xapi.storage.api.plugin.Unimplemented(base)

Use the new xapi.storage package hierarchy
Use the new xapi.storage package hierarchy

Signed-off-by: David Scott <63c9eb0ea83039690fefa11afe17873ba8278a56@eu.citrix.com>

  
  import os
  import sys
  import xapi
- import xapi.plugin
+ import xapi.storage.api.plugin
- from xapi.storage.datapath import log
+ from xapi.storage import log
  
  
- class Implementation(xapi.plugin.Plugin_skeleton):
+ class Implementation(xapi.storage.api.plugin.Plugin_skeleton):
  
      def query(self, dbg):
          return {
              "plugin": "loopdev+blkback",
              "name": "The loopdev+blkback kernel-space datapath plugin",
              "description": ("This plugin manages and configures loop"
                              " devices which can be connected to VMs"
                              " directly via kernel-space blkback"),
              "vendor": "Citrix",
              "copyright": "(C) 2015 Citrix Inc",
              "version": "3.0",
              "required_api_version": "3.0",
              "features": [
              ],
              "configuration": {},
              "required_cluster_stack": []}
  
  if __name__ == "__main__":
      log.log_call_argv()
-     cmd = xapi.plugin.Plugin_commandline(Implementation())
+     cmd = xapi.storage.api.plugin.Plugin_commandline(Implementation())
      base = os.path.basename(sys.argv[0])
      if base == "Plugin.Query":
          cmd.query()
      else:
-         raise xapi.plugin.Unimplemented(base)
+         raise xapi.storage.api.plugin.Unimplemented(base)
  
Use the new xapi.storage package hierarchy
## Code Before:

import os
import sys
import xapi
import xapi.plugin
from xapi.storage.datapath import log


class Implementation(xapi.plugin.Plugin_skeleton):

    def query(self, dbg):
        return {
            "plugin": "loopdev+blkback",
            "name": "The loopdev+blkback kernel-space datapath plugin",
            "description": ("This plugin manages and configures loop"
                            " devices which can be connected to VMs"
                            " directly via kernel-space blkback"),
            "vendor": "Citrix",
            "copyright": "(C) 2015 Citrix Inc",
            "version": "3.0",
            "required_api_version": "3.0",
            "features": [
            ],
            "configuration": {},
            "required_cluster_stack": []}

if __name__ == "__main__":
    log.log_call_argv()
    cmd = xapi.plugin.Plugin_commandline(Implementation())
    base = os.path.basename(sys.argv[0])
    if base == "Plugin.Query":
        cmd.query()
    else:
        raise xapi.plugin.Unimplemented(base)

## Instruction:
Use the new xapi.storage package hierarchy
## Code After:

import os
import sys
import xapi
import xapi.storage.api.plugin
from xapi.storage import log


class Implementation(xapi.storage.api.plugin.Plugin_skeleton):

    def query(self, dbg):
        return {
            "plugin": "loopdev+blkback",
            "name": "The loopdev+blkback kernel-space datapath plugin",
            "description": ("This plugin manages and configures loop"
                            " devices which can be connected to VMs"
                            " directly via kernel-space blkback"),
            "vendor": "Citrix",
            "copyright": "(C) 2015 Citrix Inc",
            "version": "3.0",
            "required_api_version": "3.0",
            "features": [
            ],
            "configuration": {},
            "required_cluster_stack": []}

if __name__ == "__main__":
    log.log_call_argv()
    cmd = xapi.storage.api.plugin.Plugin_commandline(Implementation())
    base = os.path.basename(sys.argv[0])
    if base == "Plugin.Query":
        cmd.query()
    else:
        raise xapi.storage.api.plugin.Unimplemented(base)
