Ohad Basan has posted comments on this change.
Change subject: ovirt-live: migrate ovirt live plugin to otopi
......................................................................
Patch Set 3: (18 inline comments)
....................................................
File
fedora/oVirtLiveFiles/root/usr/share/ovirt-engine/setup/plugins/ovirt-engine-setup/olive/core.py
Line 23: import os
Line 24: import shutil
Line 25: import glob
Line 26: import gettext
Line 27: _ = lambda m: gettext.dgettext(message=m, domain='ovirt-engine-setup')
Done
Line 28:
Line 29:
Line 30: from otopi import util
Line 31: from otopi import plugin
Line 95: ),
Line 96:
password=self.environment[osetupcons.ConfigEnv.ADMIN_PASSWORD],
Line 97:
ca_file=osetupcons.FileLocations.OVIRT_ENGINE_PKI_ENGINE_CA_CERT,
Line 98: )
Line 99: engine_version = self._ovirtsdk_xml.params.Version(
Done
Line 100: major=self._version[0],
Line 101: minor=self._version[1],
Line 102: )
Line 103: self.logger.debug('Creating the local data storage domain')
Line 143: ISO_DOMAIN_SD_UUID],
Line 144: "images", "11111111-1111-1111-1111-111111111111")
Line 145: for filename in fileList:
Line 146: shutil.move(filename, targetPath)
Line 147: filename = os.path.join(targetPath, filename)
Done
Line 148: os.chown(
Line 149: filename, self.environment[osetupcons.
Line 150:
ConfigEnv.DEFAULT_SYSTEM_USER_VDSM],
Line 151:
self.environment[osetupcons.ConfigEnv.DEFAULT_SYSTEM_GROUP_KVM]
Line 165:
Line 166: engine_api = self._ovirtsdk_api.API(
Line 167: url='https://{fqdn}:{port}/api'.format(
Line 168: fqdn=self.environment[osetupcons.ConfigEnv.FQDN],
Line 169: port=self.environment[osetupcons.ConfigEnv.
Done
Line 170: DEFAULT_NETWORK_HTTPS_PORT],
Line 171: ),
Line 172: username='{user}@{domain}'.format(
Line 173: user=osetupcons.Const.USER_ADMIN,
Line 166: engine_api = self._ovirtsdk_api.API(
Line 167: url='https://{fqdn}:{port}/api'.format(
Line 168: fqdn=self.environment[osetupcons.ConfigEnv.FQDN],
Line 169: port=self.environment[osetupcons.ConfigEnv.
Line 170: DEFAULT_NETWORK_HTTPS_PORT],
if the default value gets overridden > where is it being saved? I will use it
Line 171: ),
Line 172: username='{user}@{domain}'.format(
Line 173: user=osetupcons.Const.USER_ADMIN,
Line 174: domain=osetupcons.Const.DOMAIN_INTERNAL,
Line 175: ),
Line 176:
password=self.environment[osetupcons.ConfigEnv.ADMIN_PASSWORD],
Line 177:
ca_file=osetupcons.FileLocations.OVIRT_ENGINE_PKI_ENGINE_CA_CERT,
Line 178: )
Line 179: engine_version = self._ovirtsdk_xml.params.Version(
Done
Line 180: major=self._version[0],
Line 181: minor=self._version[1],
Line 182: )
Line 183:
Line 181: minor=self._version[1],
Line 182: )
Line 183:
Line 184: # Defins OS param for the boot option
Line 185: os = params.OperatingSystem(
Done
Line 186: type_='unassigned',
Line 187: boot=[params.Boot(dev='cdrom'),
Line 188: params.Boot(dev='hd')])
Line 189:
Line 184: # Defins OS param for the boot option
Line 185: os = params.OperatingSystem(
Line 186: type_='unassigned',
Line 187: boot=[params.Boot(dev='cdrom'),
Line 188: params.Boot(dev='hd')])
Done
Line 189:
Line 190: # Create VM
Line 191: engine_api.vms.add(
Line 192: params.VM(name='local_vm',
Line 192: params.VM(name='local_vm',
Line 193: memory='1024MB',
Line 194: os=os,
cluster=engine_api.clusters.get('local_cluster'),
Line 195: template=engine_api.templates.get('Blank')))
Line 196:
Done
Line 197: # Create NIC
Line 198: engine_api.vms.get(
Line 199: 'local_vm').nics.add(
Line 200: params.NIC(name='eth0',
Line 198: engine_api.vms.get(
Line 199: 'local_vm').nics.add(
Line 200: params.NIC(name='eth0',
Line 201: network=params.Network(name='ovirtmgmt'),
Line 202: interface='virtio'))
Done
Line 203:
Line 204: sd = engine_api.storagedomains.get('local_storage')
Line 205: diskParam = params.Disk(
Line 206:
storage_domains=params.StorageDomains(storage_domain=[sd]),
Line 201: network=params.Network(name='ovirtmgmt'),
Line 202: interface='virtio'))
Line 203:
Line 204: sd = engine_api.storagedomains.get('local_storage')
Line 205: diskParam = params.Disk(
Done
Line 206:
storage_domains=params.StorageDomains(storage_domain=[sd]),
Line 207: size='6000MB',
Line 208: type_='data',
Line 209: interface='virtio',
Line 213:
Line 214: engine_api.disks.add(diskParam)
Line 215: engine_api.vms.get(
Line 216: 'local_vm').disks.add(
Line 217: engine_api.disks.get(alias='local_disk'))
Done
Line 218:
Line 219:
....................................................
File
fedora/oVirtLiveFiles/root/usr/share/ovirt-engine/setup/plugins/ovirt-engine-setup/olive/oliveconst.py
Line 1: #!/bin/python
Done
Line 2:
Line 3: #OVIRT LIVE
Line 4:
Line 5:
Line 1: #!/bin/python
Line 2:
Line 3: #OVIRT LIVE
Done
Line 4:
Line 5:
Line 6: @util.export
Line 7: class Stages(object):
Line 6: @util.export
Line 7: class Stages(object):
Line 8: OVIRTLIVE_CONFIG_STORAGE = 'ovirtlivesetup.core.core.configstorage'
Line 9: OVIRTLIVE_COPY_ISO = 'ovirtlivesetup.core.copy.iso'
Line 10: OVIRTLVE_CREATE_VM = 'ovirtlivesetup.core.create.vm'
Done
Line 11:
Line 12:
Line 13: @util.export
Line 14: @util.codegen
Line 12:
Line 13: @util.export
Line 14: @util.codegen
Line 15: @osetupattrsclass
Line 16: class OVIRTLIVEEnv(object):
Done
Line 17: ENABLE = 'OVESETUP_OVIRTLIVE/enable'
Line 18:
Line 19: CONFIGURE = 'OVESETUP_OL/configure'
Line 20: LOCAL_DATA_CENTER = 'OVESETUP_AIO/localDataCenter'
Line 36: STORAGE_DOMAIN_NAME = 'OVESETUP_AIO/storageDomainName'
Line 37:
Line 38:
Line 39: @util.export
Line 40: class OVIRTLIVEDefaults(object):
Done
Line 41: DEFAULT_LOCAL_DATA_CENTER = 'local_datacenter'
Line 42: DEFAULT_LOCAL_CLUSTER = 'local_cluster'
Line 43: DEFAULT_LOCAL_HOST = 'local_host'
Line 44: DEFAULT_STORAGE_DOMAIN_NAME = 'local_storage'
Line 48: @util.export
Line 49: @util.codegen
Line 50: class OVIRTLIVEConst(object):
Line 51: MINIMUM_SPACE_STORAGEDOMAIN_MB = 10240
Line 52:
Done
--
To view, visit http://gerrit.ovirt.org/17518
To unsubscribe, visit http://gerrit.ovirt.org/settings
Gerrit-MessageType: comment
Gerrit-Change-Id: I703f64dc1183a6fe176d9d0352f93de381d906bb
Gerrit-PatchSet: 3
Gerrit-Project: ovirt-live
Gerrit-Branch: master
Gerrit-Owner: Ohad Basan <[email protected]>
Gerrit-Reviewer: Alex Lourie <[email protected]>
Gerrit-Reviewer: Alon Bar-Lev <[email protected]>
Gerrit-Reviewer: David Caro <[email protected]>
Gerrit-Reviewer: Eyal Edri <[email protected]>
Gerrit-Reviewer: Itamar Heim <[email protected]>
Gerrit-Reviewer: Moran Goldboim <[email protected]>
Gerrit-Reviewer: Ofer Schreiber <[email protected]>
Gerrit-Reviewer: Ohad Basan <[email protected]>
Gerrit-Reviewer: Sandro Bonazzola <[email protected]>
Gerrit-Reviewer: Yedidyah Bar David <[email protected]>
_______________________________________________
Engine-patches mailing list
[email protected]
http://lists.ovirt.org/mailman/listinfo/engine-patches