svn keywords
[plcapi.git] / PLC / Peers.py
index 0973c3d..80265bf 100644 (file)
@@ -1,3 +1,5 @@
+# $Id$
+# $URL$
 #
 # Thierry Parmentelat - INRIA
 # 
@@ -16,8 +18,8 @@ from PLC.Sites import Site, Sites
 from PLC.Persons import Person, Persons
 from PLC.Keys import Key, Keys
 from PLC.Nodes import Node, Nodes
-from PLC.SliceAttributeTypes import SliceAttributeType, SliceAttributeTypes
-from PLC.SliceAttributes import SliceAttribute, SliceAttributes
+from PLC.TagTypes import TagType, TagTypes
+from PLC.SliceTags import SliceTag, SliceTags
 from PLC.Slices import Slice, Slices
 
 class Peer(Row):
@@ -28,14 +30,15 @@ class Peer(Row):
 
     table_name = 'peers'
     primary_key = 'peer_id'
-    join_tables = ['peer_site', 'peer_person', 'peer_key', 'peer_node',
-                   'peer_slice_attribute_type', 'peer_slice_attribute', 'peer_slice']
+    join_tables = ['peer_site', 'peer_person', 'peer_key', 'peer_node', 'peer_slice']
     fields = {
        'peer_id': Parameter (int, "Peer identifier"),
        'peername': Parameter (str, "Peer name"),
        'peer_url': Parameter (str, "Peer API URL"),
        '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"),
@@ -63,7 +66,9 @@ class Peer(Row):
         (scheme, netloc, path, params, query, fragment) = urlparse(url)
         if scheme != "https":
             raise PLCInvalidArgument, "Peer URL scheme must be https"
-
+        if path[-1] != '/':
+            raise PLCInvalidArgument, "Peer URL should end with /"
+        
        return url
 
     def delete(self, commit = True):