diff options
| author | Jerome Martin <jxm@risingtidesystems.com> | 2011-06-09 11:10:29 +0200 |
|---|---|---|
| committer | Jerome Martin <jxm@risingtidesystems.com> | 2011-06-09 11:17:59 +0200 |
| commit | 6b17137efd659394322e129815bc8115b5b3c3f5 (patch) | |
| tree | 64fa69ca56043c48f181a8cc6b8d6eaa3e181fa2 | |
| parent | 0466fe1b352f7fac5c61c1dff9d49a87dc9c6290 (diff) | |
| download | targetcli-6b17137efd659394322e129815bc8115b5b3c3f5.tar.gz | |
Added discovery_auth support to fabric modules UI.
| -rw-r--r-- | rtsadmin/ui_target.py | 50 |
1 files changed, 50 insertions, 0 deletions
diff --git a/rtsadmin/ui_target.py b/rtsadmin/ui_target.py index 5b073ee..706c0d3 100644 --- a/rtsadmin/ui_target.py +++ b/rtsadmin/ui_target.py @@ -32,6 +32,56 @@ class UIFabricModule(UIRTSLibNode): self.name = fabric_module.name self.cfs_cwd = fabric_module.path self.refresh() + if self.rtsnode.has_feature('discovery_auth'): + for param in ['userid', 'password', + 'mutual_userid', 'mutual_password', + 'enable']: + self.define_config_group_param('discovery_auth', + param, 'string') + self.refresh() + + def ui_getgroup_discovery_auth(self, auth_attr): + ''' + This is the backend method for getting discovery_auth attributes. + @param auth_attr: The auth attribute to get the value of. + @type auth_attr: str + @return: The auth attribute's value + @rtype: str + ''' + value = None + if auth_attr == 'password': + value = self.rtsnode.discovery_password + elif auth_attr == 'userid': + value = self.rtsnode.discovery_userid + elif auth_attr == 'mutual_password': + value = self.rtsnode.discovery_mutual_password + elif auth_attr == 'mutual_userid': + value = self.rtsnode.discovery_mutual_userid + elif auth_attr == 'enable': + value = self.rtsnode.discovery_enable_auth + return value + + def ui_setgroup_discovery_auth(self, auth_attr, value): + ''' + This is the backend method for setting discovery auth attributes. + @param auth_attr: The auth attribute to set the value of. + @type auth_attr: str + @param value: The auth's value + @type value: str + ''' + self.assert_root() + if value is None: + value = '' + if auth_attr == 'password': + self.rtsnode.discovery_password = value + elif auth_attr == 'userid': + self.rtsnode.discovery_userid = value + elif auth_attr == 'mutual_password': + self.rtsnode.discovery_mutual_password = value + elif auth_attr == 'mutual_userid': + self.rtsnode.discovery_mutual_userid = value + elif auth_attr == 'enable': + self.rtsnode.discovery_enable_auth = value def refresh(self): self._children = set([]) |
