From: Thierry Parmentelat Date: Mon, 28 Nov 2011 15:38:03 +0000 (+0100) Subject: cosmetic X-Git-Tag: sfa-2.0-1~6^2~8 X-Git-Url: http://git.onelab.eu/?a=commitdiff_plain;h=a814183457d5c22829a7abd0ba2cc7b1e28c0ec6;p=sfa.git cosmetic --- diff --git a/sfa/managers/driver.py b/sfa/managers/driver.py index ed4ee0b9..a939ef3c 100644 --- a/sfa/managers/driver.py +++ b/sfa/managers/driver.py @@ -23,21 +23,21 @@ class Driver: return -1 # incoming record is the existing sfa_record - # error message logged if result is False + # expected retcod boolean, error message logged if result is False def remove (self, sfa_record): return True # incoming are the sfa_record: # (*) old_sfa_record is what we have in the db for that hrn # (*) new_sfa_record is what was passed in the Update call - # error message logged if result is False + # expected retcod boolean, error message logged if result is False # NOTE 1. about keys # this is confusing because a user may have several ssh keys in # the planetlab database, but we need to pick one to generate its cert # so as much as in principle we should be able to use new_sfa_record['keys'] - # the manager code actually picks one, and it's safer to pass it along - # rather than depending on the driver code to do the same - # xxx + # the manager code actually picks one (the first one), and it seems safer + # to pass it along rather than depending on the driver code to do the same + # # NOTE 2. about keys # when changing the ssh key through this method the gid gets changed too # should anything be passed back to the caller in this case ? diff --git a/sfa/plc/pldriver.py b/sfa/plc/pldriver.py index 45bbcb9a..71ef7c26 100644 --- a/sfa/plc/pldriver.py +++ b/sfa/plc/pldriver.py @@ -17,8 +17,7 @@ def list_to_dict(recs, key): convert a list of dictionaries into a dictionary keyed on the specified dictionary key """ - keys = [rec[key] for rec in recs] - return dict(zip(keys, recs)) + return dict ( [ (rec[key],rec) for rec in recs ] ) # # inheriting Driver is not very helpful in the PL case but @@ -30,7 +29,8 @@ def list_to_dict(recs, key): # # so OTOH we inherit PlShell just so one can do driver.GetNodes # which would not make much sense in the context of other testbeds -# so ultimately PlDriver might just as well drop the PlShell inheritance +# so ultimately PlDriver should drop the PlShell inheritance +# and would have a driver.shell reference to a PlShell instead # class PlDriver (Driver, PlShell): @@ -505,7 +505,7 @@ class PlDriver (Driver, PlShell): self.AddPersonToSlice, self.DeletePersonFromSlice) elif record.type == "authority": - logger.info("update_membership 'autority' not implemented") + logger.info("update_membership 'authority' not implemented") pass else: pass @@ -525,8 +525,6 @@ class PlDriver (Driver, PlShell): # build a list of the new person ids, by looking up each person to get # their pointer newIdList = [] - # xxx thgen fixme - use SfaTable hardwired for now - #table = self.SfaTable() table = SfaTable() records = table.find({'type': 'user', 'hrn': newList}) for rec in records: