GetBootMedium accepts the 'systemd-debug' option to turn on verbosity for the bootCD...
authorThierry Parmentelat <thierry.parmentelat@inria.fr>
Tue, 3 Mar 2015 15:03:43 +0000 (16:03 +0100)
committerThierry Parmentelat <thierry.parmentelat@inria.fr>
Tue, 3 Mar 2015 15:03:43 +0000 (16:03 +0100)
tag with the same name 'systemd-debug' would have the same effect

PLC/Methods/GetBootMedium.py

index 90d65e1..65cf3e9 100644 (file)
@@ -119,9 +119,10 @@ class GetBootMedium(Method):
         variants are used to run a different kernel on the bootCD
         see kvariant.sh for how to create a variant
         - 'no-hangcheck' - disable hangcheck
         variants are used to run a different kernel on the bootCD
         see kvariant.sh for how to create a variant
         - 'no-hangcheck' - disable hangcheck
+        - 'systemd-debug' - turn on systemd debug in bootcd
 
     Tags: the following tags are taken into account when attached to the node:
 
     Tags: the following tags are taken into account when attached to the node:
-        'serial', 'cramfs', 'kvariant', 'kargs', 'no-hangcheck'
+        'serial', 'cramfs', 'kvariant', 'kargs', 'no-hangcheck', 'systemd-debug'
 
     Security:
         - Non-admins can only generate files for nodes at their sites.
 
     Security:
         - Non-admins can only generate files for nodes at their sites.
@@ -415,20 +416,23 @@ class GetBootMedium(Method):
             # check for node tag equivalents
             tags = NodeTags(self.api,
                             {'node_id': node['node_id'],
             # check for node tag equivalents
             tags = NodeTags(self.api,
                             {'node_id': node['node_id'],
-                             'tagname': ['serial', 'cramfs', 'kvariant', 'kargs', 'no-hangcheck']},
+                             'tagname': ['serial', 'cramfs', 'kvariant', 'kargs',
+                                         'no-hangcheck', 'systemd-debug' ]},
                             ['tagname', 'value'])
             if tags:
                 for tag in tags:
                     if tag['tagname'] == 'serial':
                         build_sh_spec['serial'] = tag['value']
                             ['tagname', 'value'])
             if tags:
                 for tag in tags:
                     if tag['tagname'] == 'serial':
                         build_sh_spec['serial'] = tag['value']
-                    if tag['tagname'] == 'cramfs':
+                    elif tag['tagname'] == 'cramfs':
                         build_sh_spec['cramfs'] = True
                         build_sh_spec['cramfs'] = True
-                    if tag['tagname'] == 'kvariant':
+                    elif tag['tagname'] == 'kvariant':
                         build_sh_spec['variant'] = tag['value']
                         build_sh_spec['variant'] = tag['value']
-                    if tag['tagname'] == 'kargs':
+                    elif tag['tagname'] == 'kargs':
                         build_sh_spec['kargs'] += tag['value'].split()
                         build_sh_spec['kargs'] += tag['value'].split()
-                    if tag['tagname'] == 'no-hangcheck':
+                    elif tag['tagname'] == 'no-hangcheck':
                         build_sh_spec['kargs'].append('hcheck_reboot0')
                         build_sh_spec['kargs'].append('hcheck_reboot0')
+                    elif tag['tagname'] == 'systemd-debug':
+                        build_sh_spec['kargs'].append('systemd.log_level=debug')
             # then options can override tags
             for option in options:
                 if option == "cramfs":
             # then options can override tags
             for option in options:
                 if option == "cramfs":
@@ -446,6 +450,8 @@ class GetBootMedium(Method):
                     build_sh_spec['variant']=option.replace("variant:","")
                 elif option == "no-hangcheck":
                     build_sh_spec['kargs'].append('hcheck_reboot0')
                     build_sh_spec['variant']=option.replace("variant:","")
                 elif option == "no-hangcheck":
                     build_sh_spec['kargs'].append('hcheck_reboot0')
+                elif option == "systemd-debug":
+                    build_sh_spec['kargs'].append('systemd.log_level=debug')
                 else:
                     raise PLCInvalidArgument, "unknown option %s"%option
 
                 else:
                     raise PLCInvalidArgument, "unknown option %s"%option