git://git.onelab.eu
/
sfa.git
/ commitdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
| commitdiff |
tree
raw
|
patch
|
inline
| side by side (parent:
3cfd00e
)
change remove to take type, hrn parameters; fix problems with error reporting
author
Scott Baker
<bakers@cs.arizona.edu>
Wed, 7 Jan 2009 01:49:26 +0000
(
01:49
+0000)
committer
Scott Baker
<bakers@cs.arizona.edu>
Wed, 7 Jan 2009 01:49:26 +0000
(
01:49
+0000)
plc/registry.py
patch
|
blob
|
history
diff --git
a/plc/registry.py
b/plc/registry.py
index
15816c7
..
1ed688e
100644
(file)
--- a/
plc/registry.py
+++ b/
plc/registry.py
@@
-10,7
+10,7
@@
from util.credential import Credential
from util.hierarchy import Hierarchy
from util.trustedroot import TrustedRootList
from util.cert import Keypair, Certificate
from util.hierarchy import Hierarchy
from util.trustedroot import TrustedRootList
from util.cert import Keypair, Certificate
-from util.gid import GID
+from util.gid import GID
, create_uuid
from util.geniserver import GeniServer
from util.record import GeniRecord
from util.rights import RightList
from util.geniserver import GeniServer
from util.record import GeniRecord
from util.rights import RightList
@@
-155,7
+155,7
@@
class Registry(GeniServer):
# into this authority yet.
if not table.exists():
# into this authority yet.
if not table.exists():
- report.trace("Registry: creating table for authority " + auth_name)
+ print "Registry: creating table for authority", auth_name
table.create()
return table
table.create()
return table
@@
-432,20
+432,15
@@
class Registry(GeniServer):
# the current copy of the record in the Geni database, to make sure
# that the appopriate record is removed.
# the current copy of the record in the Geni database, to make sure
# that the appopriate record is removed.
- def remove(self, cred,
record_dict
):
+ def remove(self, cred,
type, hrn
):
self.decode_authentication(cred, "remove")
self.decode_authentication(cred, "remove")
- record = GeniRecord(dict = record_dict)
- type = record.get_type()
+ self.verify_object_permission(hrn)
- self.verify_object_permission(record.get_name())
-
- auth_name = get_authority(record.get_name())
+ auth_name = get_authority(hrn)
table = self.get_auth_table(auth_name)
table = self.get_auth_table(auth_name)
- # let's not trust that the caller has a well-formed record (a forged
- # pointer field could be a disaster), so look it up ourselves
- record_list = table.resolve(type, record.get_name())
+ record_list = table.resolve(type, hrn)
if not record_list:
raise RecordNotFound(name)
record = record_list[0]
if not record_list:
raise RecordNotFound(name)
record = record_list[0]
@@
-567,7
+562,7
@@
class Registry(GeniServer):
except PlanetLabRecordDoesNotExist:
# silently drop the ones that are missing in PL.
# is this the right thing to do?
except PlanetLabRecordDoesNotExist:
# silently drop the ones that are missing in PL.
# is this the right thing to do?
- report.error("ignoring geni record " + record.get_name() + " because pl record does not exist")
+ print "ignoring geni record ", record.get_name(), " because pl record does not exist"
table.remove(record)
dicts = []
table.remove(record)
dicts = []
@@
-607,7
+602,7
@@
class Registry(GeniServer):
except PlanetLabRecordDoesNotExist:
# silently drop the ones that are missing in PL.
# is this the right thing to do?
except PlanetLabRecordDoesNotExist:
# silently drop the ones that are missing in PL.
# is this the right thing to do?
- report.error("ignoring geni record " + record.get_name() + " because pl record does not exist")
+ print "ignoring geni record ", record.get_name(), "because pl record does not exist"
table.remove(record)
return good_records
table.remove(record)
return good_records