add steps to build and install Monitor docs into plc
[myplc.git] / db-config
index ea65361..4a1a22d 100755 (executable)
--- a/db-config
+++ b/db-config
@@ -98,6 +98,7 @@ def main():
         ]
 
     #################### interface settings
+    # xxx this should move to PLC/Accessors
 
     # Setup default slice attribute types
     default_setting_types = [
@@ -138,6 +139,7 @@ def main():
         ]
 
     #################### slice attributes
+    # xxx this should move to PLC/Accessors
 
     # Setup default slice attribute types
     default_attribute_types = [
@@ -457,34 +459,6 @@ def main():
          'ignore_cmd_errors': False,
          'always_update': False},
 
-        # XXX Required for old Node Manager
-        # Proper configuration
-        {'enabled': True,
-         'source': 'PlanetLabConf/propd.conf',
-         'dest': '/etc/proper/propd.conf',
-         'file_permissions': '644',
-         'file_owner': 'root',
-         'file_group': 'root',
-         'preinstall_cmd': '',
-         'postinstall_cmd': '/etc/init.d/proper restart',
-         'error_cmd': '',
-         'ignore_cmd_errors': True,
-         'always_update': False},
-
-        # XXX Required for old Node Manager
-        # Bandwidth cap
-        {'enabled': True,
-         'source': 'PlanetLabConf/bwlimit.php',
-         'dest': '/etc/planetlab/bwcap',
-         'file_permissions': '644',
-         'file_owner': 'root',
-         'file_group': 'root',
-         'preinstall_cmd': '',
-         'postinstall_cmd': '',
-         'error_cmd': '',
-         'ignore_cmd_errors': True,
-         'always_update': False},
-
         # Proxy ARP setup
         {'enabled': True,
          'source': 'PlanetLabConf/proxies.php',
@@ -679,6 +653,7 @@ def main():
         ]
     
     for default_slice in default_slices:
+        attributes=default_slice.pop('attributes')
         slices = GetSlices([default_slice['name']])
         if slices:
             slice = slices[0]
@@ -693,12 +668,12 @@ def main():
             # Delete unknown attributes
             for slice_tag in GetSliceTags(slice['slice_tag_ids']):
                 if (slice_tag['tagname'], slice_tag['value']) \
-                   not in default_slice['attributes']:
+                   not in attributes:
                     DeleteSliceTag(slice_tag['slice_tag_id'])
                 else:
                     slice_tags.append((slice_tag['tagname'], slice_tag['value']))
 
-        for (name, value) in default_slice['attributes']:
+        for (name, value) in attributes:
             if (name, value) not in slice_tags:
                 AddSliceTag(slice['name'], name, value)
 
@@ -953,124 +928,69 @@ message, please reply so that we may investigate the problem.
     #################### PCUs
     
     ### Setup Initial PCU information
-    pcu_types = [{'model': 'AP79xx',
-          'name': 'APC AP79xx',
-          'pcu_protocol_types': [{ 'port': 80,
-                                  'protocol': 'APC79xxHttp',
-                                  'supported': False},
-                                 { 'port': 23,
-                                  'protocol': 'APC79xx',
-                                  'supported': True},
-                                 { 'port': 22,
-                                  'protocol': 'APC79xx',
-                                  'supported': True}],
-          },
-         {'model': 'Masterswitch',
-          'name': 'APC Masterswitch',
-          'pcu_protocol_types': [{ 'port': 80,
-                                  'protocol': 'APCMasterHttp',
-                                  'supported': False},
-                                 { 'port': 23,
-                                  'protocol': 'APCMaster',
-                                  'supported': True},
-                                 { 'port': 22,
-                                  'protocol': 'APCMaster',
-                                  'supported': True}],
-          },
-         {'model': 'DS4-RPC',
-          'name': 'BayTech DS4-RPC',
-          'pcu_protocol_types': [{ 'port': 80,
-                                  'protocol': 'BayTechHttp',
-                                  'supported': False},
-                                 { 'port': 23,
-                                  'protocol': 'BayTech',
-                                  'supported': True},
-                                 { 'port': 22,
-                                  'protocol': 'BayTech',
-                                  'supported': True}],
-          },
-         {'model': 'IP-41x_IP-81x',
-          'name': 'Dataprobe IP-41x & IP-81x',
-          'pcu_protocol_types': [ { 'port': 23,
-                                  'protocol': 'IPALTelnet',
-                                  'supported': True},
-                                  { 'port': 80,
-                                  'protocol': 'IPALHttp',
-                                  'supported': False}],
-          },
-         {'model': 'DRAC3',
-          'name': 'Dell RAC Version 3',
-          'pcu_protocol_types': [],
-          },
-         {'model': 'DRAC4',
-          'name': 'Dell RAC Version 4',
-          'pcu_protocol_types': [{ 'port': 443,
-                                  'protocol': 'DRACRacAdm',
-                                  'supported': True},
-                                 { 'port': 80,
-                                  'protocol': 'DRACRacAdm',
-                                  'supported': False},
-                                 { 'port': 22,
-                                  'protocol': 'DRAC',
-                                  'supported': True}],
-          },
-         {'model': 'ePowerSwitch',
-          'name': 'ePowerSwitch 1/4/8x',
-          'pcu_protocol_types': [{ 'port': 80,
-                                  'protocol': 'ePowerSwitch',
-                                  'supported': True}],
-          },
-         {'model': 'ilo2',
-          'name': 'HP iLO2 (Integrated Lights-Out)',
-          'pcu_protocol_types': [{ 'port': 443,
-                                  'protocol': 'HPiLOHttps',
-                                  'supported': True},
-                                 { 'port': 22,
-                                  'protocol': 'HPiLO',
-                                  'supported': True}],
-          },
-         {'model': 'ilo1',
-          'name': 'HP iLO version 1',
-          'pcu_protocol_types': [],
-          },
-         {'model': 'PM211-MIP',
-          'name': 'Infratec PM221-MIP',
-          'pcu_protocol_types': [],
-          },
-         {'model': 'AMT2.5',
-          'name': 'Intel AMT v2.5 (Active Management Technology)',
-          'pcu_protocol_types': [],
-          },
-         {'model': 'AMT3.0',
-          'name': 'Intel AMT v3.0 (Active Management Technology)',
-          'pcu_protocol_types': [],
-          },
-         {'model': 'WTI_IPS-4',
-          'name': 'Western Telematic (WTI IPS-4)',
-          'pcu_protocol_types': [],
-          },
-         {'model': 'unknown',
-          'name': 'Unknown Vendor or Model',
-          'pcu_protocol_types': [{ 'port': 443,
-                                  'protocol': 'UnknownPCU',
-                                  'supported': False},
-                                 { 'port': 80,
-                                  'protocol': 'UnknownPCU',
-                                  'supported': False},
-                                 { 'port': 23,
-                                  'protocol': 'UnknownPCU',
-                                  'supported': False},
-                                 { 'port': 22,
-                                  'protocol': 'UnknownPCU',
-                                  'supported': False}],
-          }]
+       pcu_types = [
+                        {'model': 'APCControl12p3',
+                         'name': 'APC AP79xx or Masterswitch (sequence 1-2-port-3)', },
+                        {'model': 'APCControl1p4',
+                         'name': 'APC AP79xx or Masterswitch (sequence 1-port-4)', },
+                        {'model': 'APCControl121p3',
+                         'name': 'APC AP79xx or Masterswitch (sequence 1-2-1-port-3)', },
+                        {'model': 'APCControl121p1',
+                         'name': 'APC AP79xx or Masterswitch (sequence 1-2-1-port-1)', },
+                        {'model': 'APCControl13p13',
+                         'name': 'APC AP79xx or Masterswitch (sequence 1-3-port-1-3)', },
+
+                        {'model': 'BayTechRPC3NC', 
+                         'name': 'BayTech with prompt RPC3-NC>', },
+                        {'model': 'BayTechRPC16', 
+                         'name': 'BayTech with prompt RPC-16>', },
+                        {'model': 'BayTech',
+                         'name': 'BayTech with prompt DS-RPC>', },
+                        {'model': 'BayTechCtrlC', 
+                         'name': 'BayTech Ctrl-C, 5, then with prompt DS-RPC>', },
+                        {'model': 'BayTechCtrlCUnibe', 
+                         'name': 'BayTech Ctrl-C, 3, then with prompt DS-RPC>', },
+
+                        {'model': 'BlackBoxPSMaverick',
+                         'name': 'BlackBoxPSMaverick Web based controller'},
+
+                        {'model': 'IPAL', 
+                         'name': 'IPAL - Dataprobe IP-41x & IP-81x', },
+                        {'model': 'DRAC',
+                         'name': 'DRAC - Dell RAC Version 3 or 4', },
+                        {'model': 'ePowerSwitchNew',
+                         'name': 'ePowerSwitch Newer Models 1/4/8x', },
+                        {'model': 'ePowerSwitchOld',
+                         'name': 'ePowerSwitch Older Models 1/4/8x', },
+
+                        {'model': 'HPiLO',
+                         'name': 'HP iLO v1 or v2 (Integrated Lights-Out)', },
+
+                        {'model': 'IntelAMT',
+                         'name': 'Intel AMT v2.5 or v3.0 (Active Management Technology)', },
+
+                        {'model': 'IPMI',
+                         'name': 'OpenIPMI - Intelligent Platform Management Interface', },
+
+                        {'model': 'PM211MIP',
+                         'name': 'Infratec PM221-MIP', },
+
+                        {'model': 'WTIIPS4',
+                         'name': 'Western Telematic (WTI IPS-4)', },
+
+                        {'model': 'ManualPCU',
+                         'name': 'Manual Administrator Operation (choose if model unknown)', },
+                         ]
 
     # Get all model names
     pcu_models = [type['model'] for type in GetPCUTypes()]
     for type in pcu_types:
-        protocol_types = type['pcu_protocol_types']
-        # Take this value out of the struct.
-        del type['pcu_protocol_types']
+               if 'pcu_protocol_types' in type:
+               protocol_types = type['pcu_protocol_types']
+               # Take this value out of the struct.
+               del type['pcu_protocol_types']
+               else:
+                       protocol_types = []
         if type['model'] not in pcu_models:
             # Add the name/model info into DB
             id = AddPCUType(type)