if app.verbose > 2:
print("{c}-Object:\n{a}".format(c=app.__class__.__name__, a=app))
-app()
+# app()
sys.exit(0)
# root_dir = /var/lib/cobbler
+# templates_tir = templates
+
+# snippets_dir = snippets
+
# profile =
# profile_repos = pp-centos8-baseos
from .xlate import __mo_file__ as __xlate_mo_file__
from .xlate import XLATOR, LOCALE_DIR, DOMAIN
-__version__ = '1.3.1'
+__version__ = '1.4.0'
LOG = logging.getLogger(__name__)
_ = XLATOR.gettext
self.perform_arg_parser_vmware()
- if not self.config.password:
+ if not self.config.vsphere_info.password:
prompt = (_('Enter password for host {h!r} and user {u!r}:') + ' ').format(
- h=self.config.vsphere_host, u=self.config.vsphere_user)
- self.config.password = getpass.getpass(prompt=prompt)
+ h=self.config.vsphere_info.host, u=self.config.vsphere_info.user)
+ self.config.vsphere_info.password = getpass.getpass(prompt=prompt)
self.handler = CrTplHandler(
appname=self.appname, verbose=self.verbose, base_dir=self.base_dir,
"""
if self.args.host:
- self.config.vsphere_host = self.args.host
+ self.config.vsphere_info.host = self.args.host
if self.args.port:
- self.config.vsphere_port = self.args.port
+ self.config.vsphere_info.port = self.args.port
if self.args.user:
- self.config.vsphere_user = self.args.user
+ self.config.vsphere_info.user = self.args.user
if self.args.password:
- self.config.password = self.args.password
+ self.config.vsphere_info.password = self.args.password
if self.args.cluster:
self.config.vsphere_cluster = self.args.cluster
if self.args.folder:
self.os_id = self.default_os_id
- self.vsphere_host = self.default_vsphere_host
- self.vsphere_port = self.default_vsphere_port
- self.vsphere_user = self.default_vsphere_user
self.vsphere_cluster = self.default_vsphere_cluster
- self.dc = self.default_dc
- self.password = None
self.folder = self.default_folder
self.template_name = self.default_template_name
self.data_size_gb = self.default_data_size_gb
self.vmware_cfg_version = self.default_vmware_cfg_version
self.os_version = self.default_os_version
- self.vsphere_info = VSPhereConfigInfo(
- host=self.default_vsphere_host, port=self.default_vsphere_port, dc=self.default_dc,
- use_https=True, user=self.default_vsphere_user,
- appname=self.appname, verbose=self.verbose, base_dir=self.base_dir)
-
self.storage_cluster = self.default_storage_cluster
self.tpl_vm_domain = self.default_tpl_vm_domain
encoding=encoding, config_dir=config_dir, config_file=config_file, initialized=False,
)
+ self.vsphere_info = VSPhereConfigInfo(
+ host=self.default_vsphere_host, port=self.default_vsphere_port, dc=self.default_dc,
+ use_https=True, user=self.default_vsphere_user,
+ appname=self.appname, verbose=self.verbose, base_dir=self.base_dir,
+ initialized=True)
+
self.private_ssh_key = str(self.base_dir.joinpath('keys', self.ssh_privkey))
if initialized:
else:
res['root_password'] = '********'
- res['password'] = None
- if self.password:
- if self.verbose > 4:
- res['password'] = self.password
- else:
- res['password'] = '*******'
-
return res
# -------------------------------------------------------------------------
for (key, value) in config.items(section_name):
if key.lower() == 'host':
- self.vsphere_host = value
self.vsphere_info.host = value
continue
elif key.lower() == 'port':
- self.vsphere_port = int(value)
self.vsphere_info.port = value
continue
elif key.lower() == 'user':
- self.vsphere_user = value
self.vsphere_info.user = value
continue
elif key.lower() == 'password':
- self.password = value
self.vsphere_info.password = value
continue
elif key.lower() == 'cluster':
elif key.lower() == 'folder':
self.folder = value
elif key.lower() == 'dc':
- self.dc = value
self.vsphere_info.dc = value
elif key.lower() == 'max_nr_templates_stay':
from fb_tools.handler import BaseHandler
-from fb_tools.vsphere.errors import VSphereExpectedError
-from fb_tools.vsphere.errors import VSphereDatacenterNotFoundError
-from fb_tools.vsphere.server import VsphereServer
-from fb_tools.vsphere.iface import VsphereVmInterface
-from fb_tools.vsphere.ds import VsphereDatastore
+from fb_vmware.errors import VSphereExpectedError
+from fb_vmware.errors import VSphereDatacenterNotFoundError
+
+# from fb_tools.vsphere.server import VsphereServer
+from fb_vmware.connect import VsphereConnection
+
+from fb_vmware.iface import VsphereVmInterface
+from fb_vmware.datastore import VsphereDatastore
from . import print_section_start, print_section_end
from .xlate import XLATOR
-__version__ = '1.9.0'
+__version__ = '2.0.0'
LOG = logging.getLogger(__name__)
TZ = pytz.timezone('Europe/Berlin')
self.postinstall_errors = None
self.cobbler = None
- self.vsphere = VsphereServer(
+ self.vsphere = VsphereConnection(
+ self.config.vsphere_info, cluster=self.config.vsphere_cluster,
appname=self.appname, verbose=self.verbose, base_dir=self.base_dir,
- host=self.config.vsphere_host, port=self.config.vsphere_port,
- user=self.config.vsphere_user, password=self.config.password,
- dc=self.config.dc, cluster=self.config.vsphere_cluster,
auto_close=True, simulate=self.simulate, force=self.force, tz=TZ,
terminal_has_colors=self.terminal_has_colors, initialized=False)
+
+# self.vsphere = VsphereServer(
+# appname=self.appname, verbose=self.verbose, base_dir=self.base_dir,
+# host=self.config.vsphere_host, port=self.config.vsphere_port,
+# user=self.config.vsphere_user, password=self.config.password,
+# dc=self.config.dc, cluster=self.config.vsphere_cluster,
+# auto_close=True, simulate=self.simulate, force=self.force, tz=TZ,
+# terminal_has_colors=self.terminal_has_colors, initialized=False)
self.cluster = None
self.cobbler = Cobbler(