From: Thierry Parmentelat Date: Mon, 18 Jan 2010 17:14:40 +0000 (+0000) Subject: reordered X-Git-Tag: MyPLC-5.0-1^2~17 X-Git-Url: http://git.onelab.eu/?p=myplc.git;a=commitdiff_plain;h=50e2adc8f9e2a58efafedbad31b66b347b0ac61f reordered --- diff --git a/db-config.d/001-admin_user b/db-config.d/001-admin_user new file mode 100644 index 0000000..8797164 --- /dev/null +++ b/db-config.d/001-admin_user @@ -0,0 +1,24 @@ +# -*-python-*- +# $Id$ +# $URL$ +#################### +# Create/update the default administrator account (should be person_id 2). + +admin = { 'person_id': 2, + 'first_name': "Default", + 'last_name': "Administrator", + 'email': plc['root_user'], + 'password': plc['root_password'] } +persons = GetPersons([admin['person_id']]) +if not persons: + person_id = AddPerson(admin) + if person_id != admin['person_id']: + # Huh? Someone deleted the account manually from the database. + DeletePerson(person_id) + raise Exception, "Someone deleted the \"%s %s\" account from the database!" % \ + (admin['first_name'], admin['last_name']) + UpdatePerson(person_id, { 'enabled': True }) +else: + person_id = persons[0]['person_id'] + UpdatePerson(person_id, admin) + diff --git a/db-config.d/01-init b/db-config.d/002-system_site similarity index 71% rename from db-config.d/01-init rename to db-config.d/002-system_site index 1880c39..ced75a7 100644 --- a/db-config.d/01-init +++ b/db-config.d/002-system_site @@ -1,24 +1,10 @@ -# Create/update the default administrator account (should be person_id 2). +# -*-python-*- +# $Id$ +# $URL$ +#################### +# Create/update and populate the default site (should be site_id 1) -admin = { 'person_id': 2, - 'first_name': "Default", - 'last_name': "Administrator", - 'email': plc['root_user'], - 'password': plc['root_password'] } -persons = GetPersons([admin['person_id']]) -if not persons: - person_id = AddPerson(admin) - if person_id != admin['person_id']: - # Huh? Someone deleted the account manually from the database. - DeletePerson(person_id) - raise Exception, "Someone deleted the \"%s %s\" account from the database!" % \ - (admin['first_name'], admin['last_name']) - UpdatePerson(person_id, { 'enabled': True }) -else: - person_id = persons[0]['person_id'] - UpdatePerson(person_id, admin) - -# Create/update the default site (should be site_id 1) +### plc_www holds the contents of the PLC_WWW configuration category if plc_www['port'] == '80': url = "http://" + plc_www['host'] + "/" elif plc_www['port'] == '443': diff --git a/db-config.d/04-slicetags b/db-config.d/010-slice_tags similarity index 99% rename from db-config.d/04-slicetags rename to db-config.d/010-slice_tags index 989150b..282bc0c 100644 --- a/db-config.d/04-slicetags +++ b/db-config.d/010-slice_tags @@ -1,3 +1,6 @@ +# -*-python-*- +# $Id$ +# $URL$ #################### slice tag types # xxx this should move to PLC/Accessors diff --git a/db-config.d/02-nodetags b/db-config.d/011-node_tags similarity index 75% rename from db-config.d/02-nodetags rename to db-config.d/011-node_tags index 8991a9f..3d03521 100644 --- a/db-config.d/02-nodetags +++ b/db-config.d/011-node_tags @@ -1,3 +1,6 @@ +# -*-python-*- +# $Id$ +# $URL$ #################### node tags default_node_tags = [ { 'tagname' : 'arch', @@ -13,10 +16,6 @@ default_node_tags = [ 'category' : 'node/operation', 'min_role_id' : 10} , - { 'tagname' : 'exempt_node_until', - 'description' : 'Exclude this node from MyOps until given date (YYYYMMDD)', - 'category' : 'node/myops', - 'min_role_id' : 10} , ] for node_type in default_node_tags: SetTagType (node_type) diff --git a/db-config.d/012-interface_tags b/db-config.d/012-interface_tags new file mode 100644 index 0000000..e184c39 --- /dev/null +++ b/db-config.d/012-interface_tags @@ -0,0 +1,26 @@ +# -*-python-*- +# $Id$ +# $URL$ +#################### interface settings +# xxx this should move to PLC/Accessors + +default_interface_types = \ +[ + {'category' : "interface/general", + 'tagname' : "ifname", + 'description': "Set interface name, instead of eth0 or the like", + 'min_role_id' : 40}, + + {'category' : "interface/multihome", + 'tagname' : "alias", + 'description': "Specifies that the network is used for multihoming", + 'min_role_id' : 40}, + + {'category' : "interface/hidden", + 'tagname' : "backdoor", + 'description': "For testing new settings", + 'min_role_id' : 10}, +] + +for setting_type in default_interface_types: + SetTagType(setting_type) diff --git a/db-config.d/03-interfacesettings b/db-config.d/013-wireless_tags similarity index 61% rename from db-config.d/03-interfacesettings rename to db-config.d/013-wireless_tags index e95e224..77c6683 100644 --- a/db-config.d/03-interfacesettings +++ b/db-config.d/013-wireless_tags @@ -1,24 +1,10 @@ +# -*-python-*- +# $Id: 012-interface_tags -1 $ +# $URL: svn+ssh://thierry@svn.planet-lab.org/svn/MyPLC/trunk/db-config.d/012-interface_tags $ #################### interface settings # xxx this should move to PLC/Accessors -# Setup default slice attribute types -setting_types = \ -[ - {'category' : "interface/general", - 'tagname' : "ifname", - 'description': "Set interface name, instead of eth0 or the like", - 'min_role_id' : 40}, - - {'category' : "interface/multihome", - 'tagname' : "alias", - 'description': "Specifies that the network is used for multihoming", - 'min_role_id' : 40}, - - {'category' : "interface/hidden", - 'tagname' : "backdoor", - 'description': "For testing new settings", - 'min_role_id' : 10}, - ] + [ +wireless_interface_types = [ { 'category' : "interface/wifi", 'tagname' : x, @@ -58,5 +44,5 @@ setting_types = \ ] ] -for setting_type in setting_types: +for setting_type in wireless_interface_types: SetTagType(setting_type) diff --git a/db-config.d/11-bootstates b/db-config.d/020-boot_states similarity index 60% rename from db-config.d/11-bootstates rename to db-config.d/020-boot_states index 698abf6..b7a8a5b 100644 --- a/db-config.d/11-bootstates +++ b/db-config.d/020-boot_states @@ -1,3 +1,7 @@ +# -*-python-*- +# $Id: 012-slice_tags -1 $ +# $URL: svn+ssh://thierry@svn.planet-lab.org/svn/MyPLC/trunk/db-config.d/012-slice_tags $ +#################### slice tag types default_boot_states = [ 'boot', 'failboot', @@ -12,7 +16,7 @@ for state in default_boot_states: AddBootState(state) # TODO: Delete old boot states. -if False:# NOTE: Only set Ture if all federating peers have the new default boot states above. +if False:# NOTE: Only set to true if all federating peers have the new default boot states above. for state in current_boot_states: if state not in default_boot_states: DeleteBootState(state) diff --git a/db-config.d/05-conffiles b/db-config.d/030-conf_files similarity index 100% rename from db-config.d/05-conffiles rename to db-config.d/030-conf_files diff --git a/db-config.d/06-initscripts b/db-config.d/040-init_scripts similarity index 95% rename from db-config.d/06-initscripts rename to db-config.d/040-init_scripts index 1cc06a3..e86ec0f 100644 --- a/db-config.d/06-initscripts +++ b/db-config.d/040-init_scripts @@ -1,3 +1,6 @@ +# -*-python-*- +# $Id$ +# $URL$ #################### initscripts # Default Initscripts default_initscripts = [] diff --git a/db-config.d/10-pcutypes b/db-config.d/050-pcu_types similarity index 100% rename from db-config.d/10-pcutypes rename to db-config.d/050-pcu_types diff --git a/db-config.d/09-messages b/db-config.d/060-messages similarity index 99% rename from db-config.d/09-messages rename to db-config.d/060-messages index ce9e2dc..78eaa71 100644 --- a/db-config.d/09-messages +++ b/db-config.d/060-messages @@ -1,3 +1,6 @@ +# -*-python-*- +# $Id$ +# $URL$ #################### body for messages installfailed = """Once the node meets these requirements, please reinitiate the install diff --git a/db-config.d/07-netflow_slice b/db-config.d/080-slice_netflow similarity index 93% rename from db-config.d/07-netflow_slice rename to db-config.d/080-slice_netflow index 81549dc..7af59e0 100644 --- a/db-config.d/07-netflow_slice +++ b/db-config.d/080-slice_netflow @@ -1,3 +1,7 @@ +# -*-python-*- +# $Id$ +# $URL$ +#################### # Create/update system slices # get the MyPLC url diff --git a/db-config.d/08-sirius_slice b/db-config.d/081-slice_sirius similarity index 93% rename from db-config.d/08-sirius_slice rename to db-config.d/081-slice_sirius index 98c107f..dca2399 100644 --- a/db-config.d/08-sirius_slice +++ b/db-config.d/081-slice_sirius @@ -1,3 +1,7 @@ +# -*-python-*- +# $Id$ +# $URL$ +#################### # Create/update system slices # get the MyPLC url diff --git a/db-config.d/08-genicw_slice b/db-config.d/082-slice_sfacm similarity index 84% rename from db-config.d/08-genicw_slice rename to db-config.d/082-slice_sfacm index 080354f..eaf06fc 100644 --- a/db-config.d/08-genicw_slice +++ b/db-config.d/082-slice_sfacm @@ -1,3 +1,7 @@ +# -*-python-*- +# $Id$ +# $URL$ +#################### # Create/update system slices # get the MyPLC url @@ -10,7 +14,7 @@ Component Manger. slice = \ { - 'name': plc['slice_prefix'] + "_genicw", + 'name': plc['slice_prefix'] + "_sfacm", 'description': description, 'url': url, 'instantiation': "plc-instantiated", diff --git a/db-config.d/090-my_ops b/db-config.d/090-my_ops new file mode 100644 index 0000000..75ae9fd --- /dev/null +++ b/db-config.d/090-my_ops @@ -0,0 +1,32 @@ +# -*-python-*- +# $Id$ +# $URL$ +######## +myops_node_tags = [ + { 'tagname' : 'exempt_node_until', + 'description' : 'Exclude this node from MyOps until given date (YYYYMMDD)', + 'category' : 'node/myops', + 'min_role_id' : 10} , +] + +for node_type in myops_node_tags: SetTagType (node_type) + +######## +myops_site_tags = [ + { 'tagname' : 'exempt_site_until', + 'description' : 'Exclude this site from MyOps until given date (YYYYMMDD)', + 'category' : 'site/myops', + 'min_role_id' : 10} , +] + +for site_type in myops_site_tags: SetTagType (site_type) + +######## +myops_person_tags = [ + { 'tagname' : 'exempt_person_until', + 'description' : 'Exclude this person from MyOps until given date (YYYYMMDD)', + 'category' : 'person/myops', + 'min_role_id' : 10} , +] + +for person_type in myops_person_tags: SetTagType (person_type) diff --git a/db-config.d/12-sitetags b/db-config.d/12-sitetags deleted file mode 100644 index 982f81b..0000000 --- a/db-config.d/12-sitetags +++ /dev/null @@ -1,9 +0,0 @@ -######## -default_site_tags = [ - { 'tagname' : 'exempt_site_until', - 'description' : 'Exclude this site from MyOps until given date (YYYYMMDD)', - 'category' : 'site/myops', - 'min_role_id' : 10} , -] - -for site_type in default_site_tags: SetTagType (site_type) diff --git a/db-config.d/13-persontags b/db-config.d/13-persontags deleted file mode 100644 index d4fb89b..0000000 --- a/db-config.d/13-persontags +++ /dev/null @@ -1,9 +0,0 @@ -######## -default_person_tags = [ - { 'tagname' : 'exempt_person_until', - 'description' : 'Exclude this person from MyOps until given date (YYYYMMDD)', - 'category' : 'person/myops', - 'min_role_id' : 10} , -] - -for person_type in default_person_tags: SetTagType (person_type)