[node-patches] Change in ovirt-node[master]: add return value when persist command does not return an err...
baichm at linux.vnet.ibm.com
baichm at linux.vnet.ibm.com
Wed Jul 17 09:15:59 UTC 2013
Changming Bai has posted comments on this change.
Change subject: add return value when persist command does not return an error code on failure
......................................................................
Patch Set 7: (1 inline comment)
....................................................
File src/ovirtnode/ovirtfunctions.py
Line 760: if is_stateless():
Line 761: return rc
Line 762: if not os.path.ismount("/config"):
Line 763: logger.error("/config is not mounted")
Line 764: rc = 2
There are five return numbers (0-5), consider the user's done with the persist action. in some case the user maybe don' t want to interrupt all the persist files.
For instance, the user want to persist A B C three files and the three files listed in the list_file, the A file has already been persisted.when the user run the persist command, the user will see the warning message "the A file already persisted" and the file B/C will be persisted successfully also. last, the user get the return number 4.
So, I think we can raise an exception for some wrong conditions, for example when the rc=2 conditions occurred we can raise an exception. in other case, when the rc=3/4/5, will just output warning message in console and return the rc number, but don't interrupt the persist process.
Does this make sense?
Line 765: return rc
Line 766: if isinstance(files,STRING_TYPE):
Line 767: files_list = []
Line 768: files_list.append(files)
--
To view, visit http://gerrit.ovirt.org/14737
To unsubscribe, visit http://gerrit.ovirt.org/settings
Gerrit-MessageType: comment
Gerrit-Change-Id: I458adeddeb17f63c5d003db808044ad6c8e9e097
Gerrit-PatchSet: 7
Gerrit-Project: ovirt-node
Gerrit-Branch: master
Gerrit-Owner: Changming Bai <baichm at linux.vnet.ibm.com>
Gerrit-Reviewer: Changming Bai <baichm at linux.vnet.ibm.com>
Gerrit-Reviewer: Eli Qiao <taget at linux.vnet.ibm.com>
Gerrit-Reviewer: Fabian Deutsch <fabiand at fedoraproject.org>
Gerrit-Reviewer: Joey Boggs <jboggs at redhat.com>
Gerrit-Reviewer: Michael Burns <mburns at redhat.com>
Gerrit-Reviewer: Wenyi Gao <wenyi at linux.vnet.ibm.com>
More information about the node-patches
mailing list