if not nodes:
raise PLCInvalidArgument, "No such node"
node = nodes[0]
- PLCCheckLocalNode (node,"AddConfFileToNode")
+
+ if node['peer_id'] is not None:
+ raise PLCInvalidArgument, "Not a local node"
# Link configuration file to node
if node['node_id'] not in conf_file['node_ids']:
if not nodes:
raise PLCInvalidArgument, "No such node"
node = nodes[0]
- PLCCheckLocalNode (node,"AddNodeToNodeGroup")
+
+ if node['peer_id'] is not None:
+ raise PLCInvalidArgument, "Not a local node"
# Get nodegroup info
nodegroups = NodeGroups(self.api, [nodegroup_id_or_name])
nodes = Nodes(self.api, [node_id_or_hostname])
if not nodes:
raise PLCInvalidArgument, "No such node"
-
node = nodes[0]
- PLCCheckLocalNode(node,"AddNodeToPCU")
+
+ if node['peer_id'] is not None:
+ raise PLCInvalidArgument, "Not a local node"
# Get PCU
pcus = PCUs(self.api, [pcu_id])
if not pcus:
raise PLCInvalidArgument, "No such PCU"
-
pcu = pcus[0]
if 'admin' not in self.caller['roles']:
if not persons:
raise PLCInvalidArgument, "No such account"
person = persons[0]
- PLCCheckLocalPerson (person,"AddPersonKey")
+
+ if person['peer_id'] is not None:
+ raise PLCInvalidArgument, "Not a local account"
# If we are not admin, make sure caller is adding a key to their account
if 'admin' not in self.caller['roles']:
persons = Persons(self.api, [person_id_or_email])
if not persons:
raise PLCInvalidArgument, "No such account"
-
person = persons[0]
- PLCCheckLocalPerson(person,"AddPersonToSite")
+
+ if person['peer_id'] is not None:
+ raise PLCInvalidArgument, "Not a local account"
# Get site information
sites = Sites(self.api, [site_id_or_login_base])
if not sites:
raise PLCInvalidArgument, "No such site"
-
site = sites[0]
- PLCCheckLocalSite(site,"AddPersonToSite")
+
+ if site['peer_id'] is not None:
+ raise PLCInvalidArgument, "Not a local site"
if site['site_id'] not in person['site_ids']:
site.add_person(person)
persons = Persons(self.api, [person_id_or_email])
if not persons:
raise PLCInvalidArgument, "No such account"
-
person = persons[0]
- PLCCheckLocalPerson(person,"AdmDeletePersonKeys")
+
+ if person['peer_id'] is not None:
+ raise PLCInvalidArgument, "Not a local account"
if 'admin' not in self.caller['roles']:
if self.caller['person_id'] != person['person_id']:
if not nodes:
raise PLCInvalidArgument, "No such node"
node = nodes[0]
- PLCCheckLocalNode(node,"AdmGenerateNodeConfFile")
+
+ if node['peer_id'] is not None:
+ raise PLCInvalidArgument, "Not a local node"
# If we are not an admin, make sure that the caller is a
# member of the site at which the node is located.
if not keys:
raise PLCInvalidArgument, "No such key"
key = keys[0]
- PLCCheckLocalKey(key,"DeleteKey")
+
+ if key['peer_id'] is not None:
+ raise PLCInvalidArgument, "Not a local key"
if 'admin' not in self.caller['roles']:
if key['key_id'] not in self.caller['key_ids']:
nodes = Nodes(self.api, [node_id_or_hostname])
if not nodes:
raise PLCInvalidArgument, "No such node"
-
node = nodes[0]
- PLCCheckLocalNode(node,"DeleteNode")
+
+ if node['peer_id'] is not None:
+ raise PLCInvalidArgument, "Not a local node"
# If we are not an admin, make sure that the caller is a
# member of the site at which the node is located.
persons = Persons(self.api, [person_id_or_email])
if not persons:
raise PLCInvalidArgument, "No such account"
-
person = persons[0]
- PLCCheckLocalPerson(person,"DeletePerson")
+
+ if person['peer_id'] is not None:
+ raise PLCInvalidArgument, "Not a local account"
# Authenticated function
assert self.caller is not None
persons = Persons(self.api, [person_id_or_email])
if not persons:
raise PLCInvalidArgument, "No such account"
-
person = persons[0]
+ if person['peer_id'] is not None:
+ raise PLCInvalidArgument, "Not a local account"
+
# Get site information
sites = Sites(self.api, [site_id_or_login_base])
if not sites:
raise PLCInvalidArgument, "No such site"
-
site = sites[0]
- PLCCheckLocalSite(site,"DeletePersonFromSite")
+
+ if site['peer_id'] is not None:
+ raise PLCInvalidArgument, "Not a local site"
if site['site_id'] in person['site_ids']:
site.remove_person(person)
sites = Sites(self.api, [site_id_or_login_base])
if not sites:
raise PLCInvalidArgument, "No such site"
-
site = sites[0]
- PLCCheckLocalSite(site,"DeleteSite")
+
+ if site['peer_id'] is not None:
+ raise PLCInvalidArgument, "Not a local site"
site.delete()
if not slices:
raise PLCInvalidArgument, "No such slice"
slice = slices[0]
- PLCCheckLocalSlice(slice,"DeleteSlice")
+
+ if slice['peer_id'] is not None:
+ raise PLCInvalidArgument, "Not a local slice"
if 'admin' not in self.caller['roles']:
if self.caller['person_id'] in slice['person_ids']:
if not slice_attributes:
raise PLCInvalidArgument, "No such slice attribute"
slice_attribute = slice_attributes[0]
- PLCCheckLocalSliceAttribute(slice_attribute,"DeleteSliceAttribute")
slices = Slices(self.api, [slice_attribute['slice_id']])
if not slices:
raise PLCInvalidArgument, "No such slice"
slice = slices[0]
- PLCCheckLocalSlice(slice,"DeleteSliceAttribute")
+
+ if slice['peer_id'] is not None:
+ raise PLCInvalidArgument, "Not a local slice"
assert slice_attribute['slice_attribute_id'] in slice['slice_attribute_ids']
if not attribute_types:
raise PLCInvalidArgument, "No such slice attribute type"
attribute_type = attribute_types[0]
- PLCCheckLocalSliceAttributeType(attribute_type,"DeleteSliceAttributeType")
attribute_type.delete()
self.object_ids = [attribute_type['attribute_type_id']]
slices = Slices(self.api, [slice_id_or_name])
if not slices:
raise PLCInvalidArgument, "No such slice"
-
slice = slices[0]
- PLCCheckLocalSlice(slice,"DeleteSliceFromNodes")
+
+ if slice['peer_id'] is not None:
+ raise PLCInvalidArgument, "Not a local slice"
if 'admin' not in self.caller['roles']:
if self.caller['person_id'] in slice['person_ids']:
persons = Persons(self.api, [person_id_or_email])
if not persons:
raise PLCInvalidArgument, "No such account"
-
person = persons[0]
- PLCCheckLocalPerson(person,"SetPersonPrimarySite")
+
+ if person['peer_id'] is not None:
+ raise PLCInvalidArgument, "Not a local account"
# Authenticated function
assert self.caller is not None
sites = Sites(self.api, [site_id_or_login_base])
if not sites:
raise PLCInvalidArgument, "No such site"
-
site = sites[0]
- PLCCheckLocalSite(site,"SetPersonPrimarySite")
+
+ if site['peer_id'] is not None:
+ raise PLCInvalidArgument, "Not a local site"
if site['site_id'] not in person['site_ids']:
raise PLCInvalidArgument, "Not a member of the specified site"
if not keys:
raise PLCInvalidArgument, "No such key"
key = keys[0]
- PLCCheckLocalKey(key,"UpdateKey")
+
+ if key['peer_id'] is not None:
+ raise PLCInvalidArgument, "Not a local key"
if 'admin' not in self.caller['roles']:
if key['key_id'] not in self.caller['key_ids']:
nodes = Nodes(self.api, [node_id_or_hostname])
if not nodes:
raise PLCInvalidArgument, "No such node"
-
node = nodes[0]
- PLCCheckLocalNode(node,"UpdateNode")
+
+ if node['peer_id'] is not None:
+ raise PLCInvalidArgument, "Not a local node"
# Authenticated function
assert self.caller is not None
sites = Sites(self.api, [site_id_or_login_base])
if not sites:
raise PLCInvalidArgument, "No such site"
-
site = sites[0]
- PLCCheckLocalSite(site,"UpdateSite")
+
+ if site['peer_id'] is not None:
+ raise PLCInvalidArgument, "Not a local site"
# Authenticated function
assert self.caller is not None
if not slices:
raise PLCInvalidArgument, "No such slice"
slice = slices[0]
- PLCCheckLocalSlice(slice,"UpdateSlice")
+
+ if slice['peer_id'] is not None:
+ raise PLCInvalidArgument, "Not a local slice"
if 'admin' not in self.caller['roles']:
if self.caller['person_id'] in slice['person_ids']:
if not slice_attributes:
raise PLCInvalidArgument, "No such slice attribute"
slice_attribute = slice_attributes[0]
- PLCCheckLocalSliceAttribute(slice_attribute,"UpdateSliceAttribute")
slices = Slices(self.api, [slice_attribute['slice_id']])
if not slices:
raise PLCInvalidArgument, "No such slice"
slice = slices[0]
- PLCCheckLocalSlice(slice,"UpdateSliceAttribute")
+
+ if slice['peer_id'] is not None:
+ raise PLCInvalidArgument, "Not a local slice"
assert slice_attribute['slice_attribute_id'] in slice['slice_attribute_ids']
if not attribute_types:
raise PLCInvalidArgument, "No such attribute"
attribute_type = attribute_types[0]
- PLCCheckLocalSliceAttributeType(attribute_type,"UpdateSliceAttributeType")
attribute_type.update(attribute_type_fields)
attribute_type.sync()