From 1a5299af32460c03bab9e7d32c46e65e3e0a7843 Mon Sep 17 00:00:00 2001 From: Thierry Parmentelat Date: Tue, 29 Nov 2011 10:34:40 +0100 Subject: [PATCH] finished to clean up SFA_*_TYPE and the like --- config/default_config.xml | 21 --------------------- config/sfa_component_config | 21 ++------------------- sfa/plc/pldriver.py | 7 ------- sfa/util/config.py | 6 ------ sfa/util/table.py | 1 + 5 files changed, 3 insertions(+), 53 deletions(-) diff --git a/config/default_config.xml b/config/default_config.xml index 54272831..99c5d374 100644 --- a/config/default_config.xml +++ b/config/default_config.xml @@ -85,13 +85,6 @@ Thierry Parmentelat registry. - - Registry type - pl - The type of backend server for this - registry. Some registries may not be myplc. - - Hostname localhost @@ -129,13 +122,6 @@ Thierry Parmentelat slice manager. - - Slice Manager type - pl - The type of backend server for this - slice manager. Not all slice managers are myplc. - - Hostname localhost @@ -165,13 +151,6 @@ Thierry Parmentelat aggregate manager. - - Aggregate type - pl - The type of backend server for this - aggregate. Some aggregates may not be myplc. - - RSpec Schema /etc/sfa/pl.rng diff --git a/config/sfa_component_config b/config/sfa_component_config index d51c93b1..1bb57c8b 100644 --- a/config/sfa_component_config +++ b/config/sfa_component_config @@ -16,11 +16,6 @@ SFA_API_DEBUG=1 # Enable the registry interface SFA_REGISTRY_ENABLED=0 -# -# The type of backend server for this registry -# Some registries may not be myplc -SFA_REGISTRY_TYPE='pl' - # Root Auth # The hrn of the registry's root auth SFA_REGISTRY_ROOT_AUTH="plc" @@ -32,6 +27,8 @@ SFA_REGISTRY_ROOT_AUTH="plc" # xxx could be determined from hrn above SFA_REGISTRY_LEVEL1_AUTH="" +SFA_GENERIC_FLAVOUR='pl' + # Hostname # The fully qualified hostname of the registry server SFA_REGISTRY_HOST="localhost" @@ -47,12 +44,6 @@ SFA_REGISTRY_PORT=12345 ## Enable the aggregate inteface. SFA_AGGREGATE_ENABLED=0 -# Aggregate Type -# -# The type of backend server for this aggregate -# Some aggregates may not be myplc -SFA_AGGREGATE_TYPE='pl' - # # ## Hostname @@ -70,14 +61,6 @@ SFA_AGGREGATE_PORT=12346 # Enable the slice manager SFA_SM_ENABLED=0 -# Slice Manager type -# -## The type of backend server for this slice manager -## The slice manager doesnt rely on a specific backend server so -## you probably will never need to change this type unless you -## need to reimplement the slice manager -SFA_SM_TYPE='pl' - # Host ## The fully qualified hostname or IP address of the slice manager server SFA_SM_HOST="localhost" diff --git a/sfa/plc/pldriver.py b/sfa/plc/pldriver.py index 74db778d..a93ebd52 100644 --- a/sfa/plc/pldriver.py +++ b/sfa/plc/pldriver.py @@ -35,13 +35,6 @@ class PlDriver (Driver, PlShell): PlShell.__init__ (self, config) self.hrn = config.SFA_INTERFACE_HRN - # xxx thgen fixme - use SfaTable hardwired for now - # will need to extend generic to support multiple storage systems - #self.SfaTable = SfaTable - # Initialize the PLC shell only if SFA wraps a myPLC - rspec_type = config.get_aggregate_type() - assert (rspec_type == 'pl' or rspec_type == 'vini' or \ - rspec_type == 'eucalyptus' or rspec_type == 'max') ########## disabled users def is_enabled (self, record): diff --git a/sfa/util/config.py b/sfa/util/config.py index 2261dda5..f114a2df 100644 --- a/sfa/util/config.py +++ b/sfa/util/config.py @@ -76,12 +76,6 @@ class Config: return (aggr_mgr_ip,aggr_mgr_port) - def get_aggregate_type(self): - if (hasattr(self,'SFA_AGGREGATE_TYPE')): - return self.SFA_AGGREGATE_TYPE - else: - return "pl" - def get_interface_hrn(self): if (hasattr(self,'SFA_INTERFACE_HRN')): return self.SFA_INTERFACE_HRN diff --git a/sfa/util/table.py b/sfa/util/table.py index 065e8abb..5fdafeff 100644 --- a/sfa/util/table.py +++ b/sfa/util/table.py @@ -34,6 +34,7 @@ class SfaTable(list): if tables: return True return False + def db_fields(self, obj=None): db_fields = self.db.fields(self.SFA_TABLE_PREFIX) -- 2.43.0