From f5e64036f0d227996392f8c100f447a6cbd97069 Mon Sep 17 00:00:00 2001 From: Mark Huang Date: Fri, 20 Oct 2006 17:51:32 +0000 Subject: [PATCH] - use base class __init__() and delete() implementations - don't look up NodeNetworks hostnames --- PLC/Nodes.py | 14 ++------------ 1 file changed, 2 insertions(+), 12 deletions(-) diff --git a/PLC/Nodes.py b/PLC/Nodes.py index 86dc061..0da2865 100644 --- a/PLC/Nodes.py +++ b/PLC/Nodes.py @@ -4,7 +4,7 @@ # Mark Huang # Copyright (C) 2006 The Trustees of Princeton University # -# $Id: Nodes.py,v 1.10 2006/10/11 19:51:18 mlhuang Exp $ +# $Id: Nodes.py,v 1.11 2006/10/11 20:48:58 mlhuang Exp $ # from types import StringTypes @@ -52,17 +52,13 @@ class Node(Row): 'session': Parameter(str, "(Admin only) Node session value", max = 256), 'nodenetwork_ids': Parameter([int], "List of network interfaces that this node has", ro = True), 'nodegroup_ids': Parameter([int], "List of node groups that this node is in", ro = True), - # 'conf_file_ids': Parameter([int], "List of configuration files specific to this node", ro = True), + 'conf_file_ids': Parameter([int], "List of configuration files specific to this node", ro = True), # 'root_person_ids': Parameter([int], "(Admin only) List of people who have root access to this node", ro = True), 'slice_ids': Parameter([int], "List of slices on this node", ro = True), 'pcu_ids': Parameter([int], "List of PCUs that control this node", ro = True), 'ports': Parameter([int], "List of PCU ports that this node is connected to", ro = True), } - def __init__(self, api, fields): - Row.__init__(self, fields) - self.api = api - def validate_hostname(self, hostname): if not valid_hostname(hostname): raise PLCInvalidArgument, "Invalid hostname" @@ -72,12 +68,6 @@ class Node(Row): if 'node_id' not in self or self['node_id'] != node_id: raise PLCInvalidArgument, "Hostname already in use" - # Check for conflicts with a nodenetwork hostname - conflicts = NodeNetworks(self.api, [hostname]) - for nodenetwork_id in conflicts: - if 'nodenetwork_ids' not in self or nodenetwork_id not in self['nodenetwork_ids']: - raise PLCInvalidArgument, "Hostname already in use" - return hostname def validate_boot_state(self, boot_state): -- 2.43.0