Discussion:
[Libstoragemgmt-devel] [PATCH 2/3] ontap.py: Fix variable in error msg
Tony Asleson
2014-07-24 21:01:38 UTC
Permalink
If we didn't find the access group then g will be None
and we will be unable to do g.name.

Signed-off-by: Tony Asleson <***@redhat.com>
---
plugin/ontap/ontap.py | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/plugin/ontap/ontap.py b/plugin/ontap/ontap.py
index b490e78..33525a2 100644
--- a/plugin/ontap/ontap.py
+++ b/plugin/ontap/ontap.py
@@ -734,7 +734,7 @@ class Ontap(IStorageAreaNetwork, INfs):

raise LsmError(ErrorNumber.LSM_PLUGIN_BUG,
"access_group_create(): Unable to find access group "
- "%s just created!" % g.name)
+ "%s just created!" % name)

@handle_ontap_errors
def access_group_delete(self, access_group, flags=0):
--
1.8.2.1
Tony Asleson
2014-07-24 21:01:39 UTC
Permalink
sys was used in an outer scope which could cause future
problems if we renamed local and forgot an instance. Then
we would have the case where the global scope was being
used instead of the local.

Signed-off-by: Tony Asleson <***@redhat.com>
---
tools/lsmcli/cmdline.py | 4 ++--
1 file changed, 2 insertions(+), 2 deletions(-)

diff --git a/tools/lsmcli/cmdline.py b/tools/lsmcli/cmdline.py
index 4e6be67..0af2034 100644
--- a/tools/lsmcli/cmdline.py
+++ b/tools/lsmcli/cmdline.py
@@ -949,9 +949,9 @@ class CmdLine:
## Creates an access group.
def access_group_create(self, args):
init_type = ag_init_type_str_to_lsm(args.init_type)
- sys = _get_item(self.c.systems(), args.sys, "system id")
+ system = _get_item(self.c.systems(), args.sys, "system id")
access_group = self.c.access_group_create(args.name, args.init,
- init_type, sys)
+ init_type, system)
self.display_data([access_group])

def _add_rm_access_grp_init(self, args, op):
--
1.8.2.1
Loading...