from .xlate import XLATOR
-__version__ = '1.6.1'
+__version__ = '1.8.0'
LOG = logging.getLogger(__name__)
_ = XLATOR.gettext
default_port = 443
default_dc = 'vmcc'
default_cluster = 'vmcc-l105-01'
- default_min_root_size_gb = 32.0
- default_guest_id = "oracleLinux7_64Guest"
+ default_min_root_size_gb = 20.0
+ default_guest_id = 'centos8_64Guest'
- default_template_name = 'oel7-template'
+ default_template_name = 'rhel9-template'
# -------------------------------------------------------------------------
def __init__(
self, appname=None, verbose=0, version=__version__, base_dir=None, name=None,
host=None, port=None, user=None, password=None, dc=None, cluster=None,
template_name=None, min_root_size_gb=None, excluded_ds=None, guest_id=None,
- initialized=False):
+ rhsm_user=None, rhsm_password=None, initialized=False):
self._name = None
self._host = self.default_host
# -----------------------------------------------------------
@property
def guest_id(self):
- """The user name to connect to the VSphere server."""
+ """The Id of the Guest OS in VSphere."""
return self._guest_id
@guest_id.setter
initialized=self.initialized, host=self.host, port=self.port, user=self.user,
password=self.password, dc=self.dc, cluster=self.cluster,
template_name=self.template_name, excluded_ds=self.excluded_ds,
- min_root_size_gb=self.min_root_size_gb, guest_id=self.guest_id)
+ min_root_size_gb=self.min_root_size_gb, guest_id=self.guest_id,
+ )
return vsphere
# -------------------------------------------------------------------------
default_pdns_api_timeout = DEFAULT_PDNS_API_PORT
default_pdns_comment_account = 'provisioning'
+ default_rhsm_user = 'dpx-subscriber'
+
default_vsphere_defs = {
'live': {
'host': 'vcs01.ppbrln.internal',
self.puppetmaster = self.default_puppetmaster
self.puppetca = self.default_puppetca
self.pdns_comment_account = self.default_pdns_comment_account
+ self._rhsm_user = self.default_rhsm_user
+ self._rhsm_password = None
self._no_pdns = False
raise ValueError(msg)
self._root_max_size = val
+ # -----------------------------------------------------------
+ @property
+ def rhsm_user(self):
+ """The user used for subscribing the VM at RedHat."""
+ return self._rhsm_user
+
+ @rhsm_user.setter
+ def rhsm_user(self, value):
+ if value is None:
+ self._rhsm_user = self.default_rhsm_user
+ return
+ val = str(value).strip()
+ if val == '':
+ self._rhsm_user = self.default_rhsm_user
+ else:
+ self._rhsm_user = val
+
+ # -----------------------------------------------------------
+ @property
+ def rhsm_password(self):
+ """The password of the user used for subscribing the VM at RedHat."""
+ return self._rhsm_password
+
+ @rhsm_password.setter
+ def rhsm_password(self, value):
+ if value is None:
+ msg = _("The password of the ser used for subscribing at RedHat may not be None.")
+ raise CrTfConfigError(msg)
+ val = str(value).strip()
+ if val == '':
+ msg = _("The password of the ser used for subscribing at RedHat may not be None.")
+ raise CrTfConfigError(msg)
+ self._rhsm_password = val
+
# -------------------------------------------------------------------------
def init_vsphere_defaults(self):
res['disk_max_size'] = self.disk_max_size
res['root_min_size'] = self.root_min_size
res['root_max_size'] = self.root_max_size
+ res['rhsm_user'] = self.rhsm_user
res['vsphere'] = {}
for vsphere_name in self.vsphere.keys():
else:
res['vm_root_password'] = '*******'
+ if self.rhsm_password:
+ if show_secrets or self.verbose > 4:
+ res['rhsm_password'] = self.rhsm_password
+ else:
+ res['rhsm_password'] = '*******'
+ else:
+ res['rhsm_password'] = None
+
return res
# -------------------------------------------------------------------------