Keith Robertson has posted comments on this change.

Change subject: packaging: Fixed creating objects in an insecure way
......................................................................


Patch Set 2: (1 inline comment)

....................................................
File src/engine-iso-uploader.py
Line 413:                 if self.configuration.get("insecure"):
Line 414:                     params["insecure"] = True
Line 415:                 # Otherwise, use ca_file
Line 416:                 else:
Line 417:                     params["ca_file"] = 
self.configuration.get("engine_ca")
No, self.configuration.get("insecure") *should* resolve by default to 'False' 
which is the same as the default value for 'insecure' in the API's constructor. 
 If the user supplies a ca_file and set's 'insecure==True' then they should be 
alerted via an API thrown exception and an appropriate message from this tool 
(eg. 'ERROR: Insecure and ca_file are mutually exclusive.')

Finally, I'm not saying that the API should throw an exception when 
'insecure=True' and 'ca_file!=None'.  It could elect to prefer 'insecure' over 
the 'ca_file' or, as stated earlier, it could adopt a policy of throwing an 
exception for conflicting/invalid arguments.  All, I am saying is that the 
API's constructor *must* do parameter validation.  Hence, this is a bug in the 
API.

There are many examples of programs that have mutually exclusive arguments.  
One is linux's 'cut' command.  You cannot supply -b, -c, -f together.  If you 
do it will exit with an appropriate message explaining that they are exclusive. 

[keith@whiplash ~]$ cut -d: -f 1 -c 1-8 /etc/passwd
cut: only one type of list may be specified
Line 418: 
Line 419:                 # Create an API object
Line 420:                 self.api = API(**params)
Line 421: 


--
To view, visit http://gerrit.ovirt.org/10815
To unsubscribe, visit http://gerrit.ovirt.org/settings

Gerrit-MessageType: comment
Gerrit-Change-Id: I015c6b5441f0d1e33bb3aae378a59ad8557f9da5
Gerrit-PatchSet: 2
Gerrit-Project: ovirt-iso-uploader
Gerrit-Branch: master
Gerrit-Owner: Alex Lourie <[email protected]>
Gerrit-Reviewer: Alex Lourie <[email protected]>
Gerrit-Reviewer: Alon Bar-Lev <[email protected]>
Gerrit-Reviewer: Juan Hernandez <[email protected]>
Gerrit-Reviewer: Keith Robertson <[email protected]>
Gerrit-Reviewer: Kiril Nesenko <[email protected]>
Gerrit-Reviewer: Michael Pasternak <[email protected]>
Gerrit-Reviewer: Ofer Schreiber <[email protected]>
_______________________________________________
Engine-patches mailing list
[email protected]
http://lists.ovirt.org/mailman/listinfo/engine-patches

Reply via email to