Fix potential NameError of rc_id
In create_relationship, if VolumeBackendAPIException is caught and 'CMMVC5959E' is in e, then the exception will not be raised, and then the next state of "if rc_id" will raise NameError exception, so rc_id should be initialized to avoid this potential risk. Change-Id: If8d214c205196c76125a6581c85cbfeee6b4dfbd
This commit is contained in:
parent
0023c2b58b
commit
2c67d2938f
|
@ -2124,6 +2124,7 @@ class StorwizeHelpers(object):
|
|||
rc_id = self.ssh.mkrcrelationship(master, aux, system,
|
||||
asyncmirror, cyclingmode)
|
||||
except exception.VolumeBackendAPIException as e:
|
||||
rc_id = None
|
||||
# CMMVC5959E is the code in Stowize storage, meaning that
|
||||
# there is a relationship that already has this name on the
|
||||
# master cluster.
|
||||
|
|
|
@ -2902,6 +2902,7 @@ class InStorageAssistant(object):
|
|||
rc_id = self.ssh.mkrcrelationship(master, aux, system,
|
||||
asynccopy)
|
||||
except exception.VolumeBackendAPIException as e:
|
||||
rc_id = None
|
||||
# CMMVC5959E is the code in InStorage, meaning that
|
||||
# there is a relationship that already has this name on the
|
||||
# master cluster.
|
||||
|
|
Loading…
Reference in New Issue