components/openstack/nova/files/solariszones/sysconfig.py
branchs11u3-sru
changeset 6035 c9748fcc32de
parent 4569 e6bd6f2f307f
child 6854 52081f923019
equal deleted inserted replaced
6016:a477397bba8b 6035:c9748fcc32de
   150                      value="Automatic")
   150                      value="Automatic")
   151 
   151 
   152     return svcbundle
   152     return svcbundle
   153 
   153 
   154 
   154 
   155 def create_default_root_account(expire=None, sshkey=None):
   155 def create_default_root_account(expire=None, sshkey=None, password=None):
   156     """ return an etree object representing the root account
   156     """ return an etree object representing the root account
   157     """
   157     """
   158     svcbundle = etree.Element("service_bundle", type="profile",
   158     svcbundle = etree.Element("service_bundle", type="profile",
   159                               name="openstack")
   159                               name="openstack")
   160     service = etree.SubElement(svcbundle, "service", version="1",
   160     service = etree.SubElement(svcbundle, "service", version="1",
   161                                type="service", name="system/config-user")
   161                                type="service", name="system/config-user")
   162     instance = etree.SubElement(service, "instance", enabled="true",
   162     instance = etree.SubElement(service, "instance", enabled="true",
   163                                 name="default")
   163                                 name="default")
   164     root_pg = etree.SubElement(instance, "property_group", type="application",
   164     root_pg = etree.SubElement(instance, "property_group", type="application",
   165                                name="root_account")
   165                                name="root_account")
   166     etree.SubElement(root_pg, "propval", type="astring", name="password",
       
   167                      value="NP")
       
   168     etree.SubElement(root_pg, "propval", type="astring", name="type",
   166     etree.SubElement(root_pg, "propval", type="astring", name="type",
   169                      value="normal")
   167                      value="normal")
       
   168 
       
   169     if password is not None:
       
   170         etree.SubElement(root_pg, "propval", type="astring", name="password",
       
   171                          value=password)
       
   172     else:
       
   173         etree.SubElement(root_pg, "propval", type="astring", name="password",
       
   174                          value='NP')
   170 
   175 
   171     if expire is not None:
   176     if expire is not None:
   172         etree.SubElement(root_pg, "propval", type="astring", name="expire",
   177         etree.SubElement(root_pg, "propval", type="astring", name="expire",
   173                          value=expire)
   178                          value=expire)
   174 
   179