from .ldap import LdapConnectionInfo, LdapConnectionDict
from .timeouts import ConfigTimeouts
-__version__ = '3.1.3'
+__version__ = '3.2.0'
LOG = logging.getLogger(__name__)
_ = XLATOR.gettext
re_ldap_section_w_name = re.compile(r'^\s*ldap\s*:\s*(\S+)')
re_resolv_ns_entry = re.compile(r'^\s*nameserver\s+(\S+)')
+ default_rhsm_user = 'dpx-subscriber'
+
# -------------------------------------------------------------------------
def __init__(
self, appname=None, verbose=0, version=__version__, base_dir=None,
self.ldap_timeout = DEFAULT_TIMEOUT
+ self._rhsm_user = self.default_rhsm_user
+ self._rhsm_pwd = None
+
super(CrTplConfiguration, self).__init__(
appname=appname, verbose=verbose, version=version, base_dir=base_dir,
append_appname_to_stems=append_appname_to_stems, config_dir=config_dir,
"""The path to the snippets dirctory, depending of the system status."""
return self.cobbler_rootdir / 'snippets' / 'per_status' / self.system_status
+ # -------------------------------------------------------------------------
+ @property
+ def rhsm_user(self):
+ """The user to use for subscribing a RHEL host to RedHat subscription management."""
+ return self._rhsm_user
+
+ # -------------------------------------------------------------------------
+ @property
+ def rhsm_pwd(self):
+ """The password of the RHSM user."""
+ return self._rhsm_pwd
+
# -------------------------------------------------------------------------
def as_dict(self, short=True):
"""
res['data_size'] = self.data_size
res['default_cobbler_nameservers'] = self.default_cobbler_nameservers
res['ram_gb'] = self.ram_gb
+ res['rhsm_pwd'] = None
+ res['rhsm_user'] = self.rhsm_user
res['system_ks'] = self.system_ks
res['snippets_dir'] = self.snippets_dir
else:
res['root_password'] = '********'
+ if self.rhsm_pwd:
+ if self.verbose > 4:
+ res['rhsm_pwd'] = self.rhsm_pwd
+ else:
+ res['rhsm_pwd'] = '********'
+
return res
# -------------------------------------------------------------------------
from .ldap import LdapConnectionInfo
-__version__ = '0.1.0'
+__version__ = '0.2.0'
LOG = logging.getLogger(__name__)
re_vm_domain = re.compile(r'^\s*(?:vm[-_]?)?domain\s*$', re.IGNORECASE)
re_root_pwd = re.compile(r'^\s*root[-_]?password\s*$', re.IGNORECASE)
re_swap_space = re.compile(r'^\s*swap[-_]?space(?:[-_]?mb)?\s*$', re.IGNORECASE)
+ re_rhsm_user = re.compile(r'^\s*rhsm[-_]?user\s*$', re.IGNORECASE)
+ re_rhsm_pwd = re.compile(r'^\s*rhsm[-_]?(?:pwd|password)\s*$', re.IGNORECASE)
for key in section.keys():
value = section[key]
if re_swap_space.match(key) and value.strip():
self.swap_size_mb = int(value)
continue
+ if re_rhsm_user.match(key) and value.strip():
+ self._rhsm_user = value.strip()
+ continue
+ if re_rhsm_pwd.match(key):
+ self._rhsm_pwd = value
+ continue
return