[node-patches] Change in ovirt-node[master]: add return value when persist command does not return an err...

fabiand at fedoraproject.org fabiand at fedoraproject.org
Thu May 23 11:44:21 UTC 2013


Fabian Deutsch has posted comments on this change.

Change subject: add return value when persist command does not return an error code on failure
......................................................................


Patch Set 4: I would prefer that you didn't submit this

(6 inline comments)

....................................................
File scripts/ovirt-functions.in
Line 649: # persist configuration to /config
Line 650: #   ovirt_store_config /etc/config /etc/config2 ...
Line 651: #   copy to /config and bind-mount back
Line 652: ovirt_store_config() {
Line 653:     python -c "import ovirtnode.ovirtfunctions; import sys; sys.exit(ovirt_store_config_retnum(sys.argv[1:], retNumber=True))" "$@"
There is no argument named retNumber.
Line 654:     rc=$?
Line 655:     return $rc
Line 656: }
Line 657: 


....................................................
File src/ovirtnode/ovirtfunctions.py
Line 747:     if rc == 1 or rc == 2:
Line 748:         return False
Line 749:     else:
Line 750:         return True
Line 751:     
trailing white-space
Line 752: # persist configuration to /config
Line 753: # ovirt_store_config_retnum /etc/config /etc/config2 ...
Line 754: # copy to /config and bind-mount back
Line 755: # this function can be invoked by shell script and function ovirt_store_config


Line 755: # this function can be invoked by shell script and function ovirt_store_config
Line 756: # this function will return the different error number consist with different error case.
Line 757: 
Line 758: def ovirt_store_config_retnum(files):
Line 759:     rc = 0 
trailing white-space
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 757: 
Line 758: def ovirt_store_config_retnum(files):
Line 759:     rc = 0 
Line 760:     if is_stateless():
Line 761:         return rc 
trailing white-space
Line 762:     if not os.path.ismount("/config"):
Line 763:         logger.error("/config is not mounted")
Line 764:         rc = 2
Line 765:         return rc 


Line 761:         return rc 
Line 762:     if not os.path.ismount("/config"):
Line 763:         logger.error("/config is not mounted")
Line 764:         rc = 2
Line 765:         return rc 
trailing white-space
Line 766:     if isinstance(files,STRING_TYPE):
Line 767:         files_list = [] 
Line 768:         files_list.append(files)
Line 769:     else:


Line 763:         logger.error("/config is not mounted")
Line 764:         rc = 2
Line 765:         return rc 
Line 766:     if isinstance(files,STRING_TYPE):
Line 767:         files_list = [] 
trailing white-space
Line 768:         files_list.append(files)
Line 769:     else:
Line 770:         files_list=files
Line 771:     for f in files_list:


--
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: 4
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