Exemplo n.º 1
0
 def __init__(self, name, parent=None, shell=None):
     ConfigNode.__init__(self, name, parent, shell)
     self.define_config_group_param(
         'global', 'export_backstore_name_as_model', 'bool',
         'If true, the backstore name is used for the scsi inquiry model name.'
     )
     self.define_config_group_param(
         'global', 'auto_enable_tpgt', 'bool',
         'If true, automatically enables TPGTs upon creation.')
     self.define_config_group_param(
         'global', 'auto_add_mapped_luns', 'bool',
         'If true, automatically create node ACLs mapped LUNs ' +
         'after creating a new target LUN or a new node ACL')
     self.define_config_group_param(
         'global', 'auto_cd_after_create', 'bool',
         'If true, changes current path to newly created objects.')
     self.define_config_group_param(
         'global', 'auto_save_on_exit', 'bool',
         'If true, saves configuration on exit.')
     self.define_config_group_param(
         'global', 'auto_add_default_portal', 'bool',
         'If true, adds a portal listening on all IPs to new targets.')
     self.define_config_group_param(
         'global', 'max_backup_files', 'string',
         'Max no. of configurations to be backed up in /etc/target/backup/ directory.'
     )
     self.define_config_group_param(
         'global', 'auto_use_daemon', 'bool',
         'If true, commands will be sent to targetclid.')
Exemplo n.º 2
0
 def __init__(self, name, parent=None, shell=None):
     ConfigNode.__init__(self, name, parent, shell)
     self.define_config_group_param(
         'global', 'auto_cd_after_create', 'bool',
         'If true, changes current path to newly created objects.')
     self.define_config_group_param(
         'global', 'auto_save_on_exit', 'bool',
         'If true, saves configuration on exit.')
     self.define_config_group_param(
         'global', 'username', 'string',
         'Username to use to connect to oVirt Engine.')
     self._api = None
     self._ip = None
Exemplo n.º 3
0
 def execute_command(self, command, pparams=[], kparams={}):
     try:
         result = ConfigNode.execute_command(self, command, pparams,
                                             kparams)
     except Exception as msg:
         self.shell.log.error(str(msg))
         pass
     else:
         self.shell.log.debug("Command %s succeeded." % command)
         return result
Exemplo n.º 4
0
 def __init__(self, name, parent=None, shell=None):
     ConfigNode.__init__(self, name, parent, shell)
     self.define_config_group_param(
         'global', 'export_backstore_name_as_model', 'bool',
         'If true, the backstore name is used for the scsi inquiry model name.')
     self.define_config_group_param(
         'global', 'auto_enable_tpgt', 'bool',
         'If true, automatically enables TPGTs upon creation.')
     self.define_config_group_param(
         'global', 'auto_add_mapped_luns', 'bool',
         'If true, automatically create node ACLs mapped LUNs '
         + 'after creating a new target LUN or a new node ACL')
     self.define_config_group_param(
         'global', 'auto_cd_after_create', 'bool',
         'If true, changes current path to newly created objects.')
     self.define_config_group_param(
         'global', 'auto_save_on_exit', 'bool',
         'If true, saves configuration on exit.')
     self.define_config_group_param(
         'global', 'auto_add_default_portal', 'bool',
         'If true, adds a portal listening on all IPs to new targets.')
Exemplo n.º 5
0
 def __init__(self, name, parent=None, shell=None):
     ConfigNode.__init__(self, name, parent, shell)
     self.define_config_group_param(
         'global', 'export_backstore_name_as_model', 'bool',
         'If true, the backstore name is used for the scsi inquiry model name.'
     )
     self.define_config_group_param(
         'global', 'auto_enable_tpgt', 'bool',
         'If true, automatically enables TPGTs upon creation.')
     self.define_config_group_param(
         'global', 'auto_add_mapped_luns', 'bool',
         'If true, automatically create node ACLs mapped LUNs ' +
         'after creating a new target LUN or a new node ACL')
     self.define_config_group_param(
         'global', 'auto_cd_after_create', 'bool',
         'If true, changes current path to newly created objects.')
     self.define_config_group_param(
         'global', 'auto_save_on_exit', 'bool',
         'If true, saves configuration on exit.')
     self.define_config_group_param(
         'global', 'auto_add_default_portal', 'bool',
         'If true, adds a portal listening on all IPs to new targets.')
Exemplo n.º 6
0
 def execute_command(self, command, pparams=[], kparams={}):
     try:
         result = ConfigNode.execute_command(self, command,
                                             pparams, kparams)
     except Exception as e:
         raise e
     else:
         self.shell.log.debug("Command %s succeeded." % command)
         return result
     finally:
         if command in ["create", "delete", "delete_all", "add_initiator",
                        "allow_any_host", "split_bdev", "add_lun",
                        "add_pg_ig_maps", "remove_target", "add_secret",
                        "destruct_split_bdev", "delete_pmem_pool",
                        "create_pmem_pool", "delete_secret_all",
                        "delete_initiator", "set_auth", "delete_secret",
                        "delete_pg_ig_maps"]:
             self.get_root().refresh()
             self.refresh_node()
Exemplo n.º 7
0
 def execute_command(self, command, pparams=[], kparams={}):
     try:
         result = ConfigNode.execute_command(self, command, pparams,
                                             kparams)
     except Exception as e:
         raise e
     else:
         self.shell.log.debug("Command %s succeeded." % command)
         return result
     finally:
         if self.shell.interactive and\
             command in ["create", "delete", "delete_all", "add_initiator",
                         "allow_any_host", "bdev_split_create", "add_lun",
                         "iscsi_target_node_add_pg_ig_maps", "remove_target", "add_secret",
                         "bdev_split_delete", "bdev_pmem_delete_pool",
                         "bdev_pmem_create_pool", "delete_secret_all",
                         "delete_initiator", "set_auth", "delete_secret",
                         "iscsi_target_node_remove_pg_ig_maps", "load_config",
                         "load_subsystem_config"]:
             self.get_root().refresh()
             self.refresh_node()
Exemplo n.º 8
0
 def __init__(self, name, parent=None, shell=None):
     ConfigNode.__init__(self, name, parent, shell)
     self.logger = logging.getLogger('gwcli')
Exemplo n.º 9
0
 def __init__(self, name, parent=None, shell=None):
     ConfigNode.__init__(self, name, parent, shell)
Exemplo n.º 10
0
 def ui_setgroup_global(self, parameter, value):
     ConfigNode.ui_setgroup_global(self, parameter, value)
     self.get_root().refresh()
Exemplo n.º 11
0
 def __init__(self, name, parent=None, shell=None):
     ConfigNode.__init__(self, name, parent, shell)
     self.http_mode = self.parent.http_mode
Exemplo n.º 12
0
 def __init__(self, shell, as_root=False):
     ConfigNode.__init__(self, '/', shell=shell)
     self.as_root = as_root
Exemplo n.º 13
0
 def ui_setgroup_global(self, parameter, value):
     ConfigNode.ui_setgroup_global(self, parameter, value)
     self.get_root().refresh()