git://git.onelab.eu
/
plcapi.git
/ commitdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
| commitdiff |
tree
raw
|
patch
|
inline
| side by side (parent:
7c328b7
)
Peer object now has hrn_root
author
Thierry Parmentelat
<thierry.parmentelat@sophia.inria.fr>
Mon, 26 Jan 2009 09:53:46 +0000
(09:53 +0000)
committer
Thierry Parmentelat
<thierry.parmentelat@sophia.inria.fr>
Mon, 26 Jan 2009 09:53:46 +0000
(09:53 +0000)
PLC/Methods/AddPeer.py
patch
|
blob
|
history
PLC/Methods/DeleteNode.py
patch
|
blob
|
history
PLC/Methods/UpdatePeer.py
patch
|
blob
|
history
PLC/Peers.py
patch
|
blob
|
history
migrations/v4-to-v5/migrate.sql
patch
|
blob
|
history
planetlab5.sql
patch
|
blob
|
history
diff --git
a/PLC/Methods/AddPeer.py
b/PLC/Methods/AddPeer.py
index
d62f4ff
..
f695bab
100644
(file)
--- a/
PLC/Methods/AddPeer.py
+++ b/
PLC/Methods/AddPeer.py
@@
-9,7
+9,7
@@
from PLC.Auth import Auth
from PLC.Peers import Peer, Peers
can_update = lambda (field, value): field in \
from PLC.Peers import Peer, Peers
can_update = lambda (field, value): field in \
- ['peername', 'peer_url', 'key', 'cacert', 'shortname']
+ ['peername', 'peer_url', 'key', 'cacert', 'shortname'
, 'hrn_root'
]
class AddPeer(Method):
"""
class AddPeer(Method):
"""
diff --git
a/PLC/Methods/DeleteNode.py
b/PLC/Methods/DeleteNode.py
index
36ca6c4
..
e89d879
100644
(file)
--- a/
PLC/Methods/DeleteNode.py
+++ b/
PLC/Methods/DeleteNode.py
@@
-44,10
+44,13
@@
class DeleteNode(Method):
if node['site_id'] not in self.caller['site_ids']:
raise PLCPermissionDenied, "Not allowed to delete nodes from specified site"
if node['site_id'] not in self.caller['site_ids']:
raise PLCPermissionDenied, "Not allowed to delete nodes from specified site"
+ node_id=node['node_id']
+ site_id=node['site_id']
node.delete()
# Logging variables
node.delete()
# Logging variables
- self.event_objects = {'Node': [node['node_id']]}
+ # it's not much use to attach to the node as it's going to vanish...
+ self.event_objects = {'Node': [node_id], 'Site': [site_id] }
self.message = "Node %d deleted" % node['node_id']
return 1
self.message = "Node %d deleted" % node['node_id']
return 1
diff --git
a/PLC/Methods/UpdatePeer.py
b/PLC/Methods/UpdatePeer.py
index
ba22838
..
572d613
100644
(file)
--- a/
PLC/Methods/UpdatePeer.py
+++ b/
PLC/Methods/UpdatePeer.py
@@
-6,7
+6,7
@@
from PLC.Auth import Auth
from PLC.Peers import Peer, Peers
can_update = lambda (field, value): field in \
from PLC.Peers import Peer, Peers
can_update = lambda (field, value): field in \
- ['peername', 'peer_url', 'key', 'cacert', 'shortname']
+ ['peername', 'peer_url', 'key', 'cacert', 'shortname'
, 'hrn_root'
]
class UpdatePeer(Method):
"""
class UpdatePeer(Method):
"""
diff --git
a/PLC/Peers.py
b/PLC/Peers.py
index
2d464bb
..
bec019d
100644
(file)
--- a/
PLC/Peers.py
+++ b/
PLC/Peers.py
@@
-37,6
+37,7
@@
class Peer(Row):
'key': Parameter(str, "Peer GPG public key"),
'cacert': Parameter(str, "Peer SSL public certificate"),
'shortname' : Parameter(str, "Peer short name"),
'key': Parameter(str, "Peer GPG public key"),
'cacert': Parameter(str, "Peer SSL public certificate"),
'shortname' : Parameter(str, "Peer short name"),
+ 'hrn_root' : Parameter(str, "Root of this peer in a hierarchical naming space"),
### cross refs
'site_ids': Parameter([int], "List of sites for which this peer is authoritative"),
'person_ids': Parameter([int], "List of users for which this peer is authoritative"),
### cross refs
'site_ids': Parameter([int], "List of sites for which this peer is authoritative"),
'person_ids': Parameter([int], "List of users for which this peer is authoritative"),
diff --git
a/migrations/v4-to-v5/migrate.sql
b/migrations/v4-to-v5/migrate.sql
index
a8b9296
..
99b72bc
100644
(file)
--- a/
migrations/v4-to-v5/migrate.sql
+++ b/
migrations/v4-to-v5/migrate.sql
@@
-105,6
+105,7
@@
drop function mgn_drop_all_views ();
-- peers
----------------------------------------
ALTER TABLE peers ADD COLUMN shortname TEXT;
-- peers
----------------------------------------
ALTER TABLE peers ADD COLUMN shortname TEXT;
+ALTER TABLE peers ADD COLUMN hrn_root TEXT;
----------------------------------------
-- nodes
----------------------------------------
-- nodes
diff --git
a/planetlab5.sql
b/planetlab5.sql
index
fccc8ac
..
6c4cc98
100644
(file)
--- a/
planetlab5.sql
+++ b/
planetlab5.sql
@@
-776,6
+776,7
@@
CREATE TABLE peers (
cacert text, -- (SSL) Public certificate of peer API server
key text, -- (GPG) Public key used for authentication
shortname text, -- abbreviated name for displaying foreign objects
cacert text, -- (SSL) Public certificate of peer API server
key text, -- (GPG) Public key used for authentication
shortname text, -- abbreviated name for displaying foreign objects
+ hrn_root text, -- root for this peer domain
deleted boolean NOT NULL DEFAULT false
) WITH OIDS;
CREATE INDEX peers_peername_idx ON peers (peername) WHERE deleted IS false;
deleted boolean NOT NULL DEFAULT false
) WITH OIDS;
CREATE INDEX peers_peername_idx ON peers (peername) WHERE deleted IS false;