# Mark Huang <mlhuang@cs.princeton.edu>
# Copyright (C) 2006 The Trustees of Princeton University
#
-# $Id$
+# $Id: NodeNetworks.py,v 1.2 2006/09/15 20:31:59 tmack Exp $
#
from types import StringTypes
'is_primary': Parameter(bool, "Is the primary interface for this node"),
}
+ all_fields = dict(join_fields.items() + fields.items())
+
methods = ['static', 'dhcp', 'proxy', 'tap', 'ipmi', 'unknown']
types = ['ipv4']
def validate_method(self, method):
if method not in self.methods:
raise PLCInvalidArgument, "Invalid addressing method"
+ return method
def validate_type(self, type):
if type not in self.types:
raise PLCInvalidArgument, "Invalid address type"
+ return type
def validate_ip(self, ip):
try:
def validate_bwlimit(self, bwlimit):
if bwlimit not in self.bwlimits:
raise PLCInvalidArgument, "Invalid bandwidth limit"
+ return bwlimit
def validate_hostname(self, hostname):
# Optional
nodenetwork_ids = filter(lambda nodenetwork_id: isinstance(nodenetwork_id, (int, long)),
nodenetwork_id_or_hostname_list)
hostnames = filter(lambda hostname: isinstance(hostname, StringTypes),
- nodenetwork_id_or_hostname_list)
+ nodenetwork_id_or_hostname_list)
sql += " WHERE (False"
if nodenetwork_ids:
sql += " OR nodenetwork_id IN (%s)" % ", ".join(map(str, nodenetwork_ids))