if filter(lambda field: field not in self.update_fields, update_fields):
raise PLCInvalidArgument, "Invalid field specified"
- # XML-RPC cannot marshal None, so we need special values to
- # represent "unset".
- for key, value in update_fields.iteritems():
- if value == -1 or value == "null":
- if key in ['hostname', 'boot_state']:
- raise PLCInvalidArgument, "hostname and boot_state cannot be unset"
- update_fields[key] = None
-
# Get account information
nodes = Nodes(self.api, [node_id_or_hostname])
if not nodes:
if filter(lambda field: field not in self.update_fields, update_fields):
raise PLCInvalidArgument, "Invalid fields specified"
- # XML-RPC cannot marshal None, so we need special values to
- # represent "unset".
- for key, value in update_fields.iteritems():
- if value == -1 or value == "null":
- if key in ['method', 'type', 'mac', 'ip', 'bwlimit']:
- raise PLCInvalidArgument, "%s cannot be unset" % key
- update_fields[key] = None
-
# Get node network information
nodenetworks = NodeNetworks(self.api, [nodenetwork_id_or_hostname]).values()
if not nodenetworks:
if filter(lambda field: field not in self.update_fields, update_fields):
raise PLCInvalidArgument, "Invalid field specified"
- # XML-RPC cannot marshal None, so we need special values to
- # represent "unset".
- for key, value in update_fields.iteritems():
- if value == -1 or value == "null":
- if key in ['first_name', 'last_name']:
- raise PLCInvalidArgument, "first_name and last_name cannot be unset"
- update_fields[key] = None
-
# Get account information
persons = Persons(self.api, [person_id_or_email])
if not persons:
if filter(lambda field: field not in self.update_fields, update_fields):
raise PLCInvalidArgument, "Invalid field specified"
- # XML-RPC cannot marshal None, so we need special values to
- # represent "unset".
- for key, value in update_fields.iteritems():
- if value == -1 or value == "null":
- if key not in ['latitude', 'longitude', 'url']:
- raise PLCInvalidArgument, "%s cannot be unset" % key
- update_fields[key] = None
-
# Get site information
sites = Sites(self.api, [site_id_or_login_base])
if not sites: