In the case of RHEV-M and VMWare, image factory target names differ
from deltacloud driver names. As of 3b20568b, we attempt to map
deltacloud driver names in order to support both sets of names.
However, this doesn't account for the target name which is recorded
in IWHD. If a client requests an image to be built for 'rhevm', the
target recorded in IWHD is 'rhev-m'.
We should take the opportunity and cut out all confusion by
standardising on deltacloud driver names.
We could add some compatibility code to gracefully handle the previous
driver names, but it probably isn't warranted at this point.
https://fedorahosted.org/pipermail/aeolus-devel/2011-June/002120.html
---
Documentation/man/imgfac.1 | 2 +-
imagefactory/ApplicationConfiguration.py | 2 +-
imagefactory/BuildDispatcher.py | 7 ++++---
imagefactory/builders/BaseBuilder.py | 5 -----
imagefactory/builders/FedoraBuilder.py | 10 +++++-----
5 files changed, 11 insertions(+), 15 deletions(-)
diff --git a/Documentation/man/imgfac.1 b/Documentation/man/imgfac.1
index d434fa0..40d2530 100644
--- a/Documentation/man/imgfac.1
+++ b/Documentation/man/imgfac.1
@@ -72,7 +72,7 @@ Template to build from. Template can be passed as URL, PATH, UUID or
XML. Please
section at the bottom.
.B --target TARGET
-The list of cloud services to target. Examples include ec2, rhev-m, vmware, rackspace,
condorcloud and gogrid.
+The list of cloud services to target. Examples include ec2, rhevm, vsphere, rackspace,
condorcloud and gogrid.
.SS Image pushing:
diff --git a/imagefactory/ApplicationConfiguration.py
b/imagefactory/ApplicationConfiguration.py
index 989f2bb..d50207d 100644
--- a/imagefactory/ApplicationConfiguration.py
+++ b/imagefactory/ApplicationConfiguration.py
@@ -64,7 +64,7 @@ class ApplicationConfiguration(Singleton):
group_build = argparser.add_argument_group(title='Image building',
description=cli_build_description)
group_build.add_argument('--template', help='Template XML file to
build from.')
- group_build.add_argument('--target', action='append',
help='Cloud services to target (e.g. ec2, rhev-m, rackspace, condorcloud, etc.)')
+ group_build.add_argument('--target', action='append',
help='Cloud services to target (e.g. ec2, rhevm, vsphere, rackspace, condorcloud,
etc.)')
group_push = argparser.add_argument_group(title='Image pushing',
description=cli_push_description)
group_push.add_argument('--provider', action='append',
help='Cloud service providers to push the image (e.g. ec2-us-east-1, rackspace,
etc.)')
diff --git a/imagefactory/BuildDispatcher.py b/imagefactory/BuildDispatcher.py
index 1d76626..979beae 100644
--- a/imagefactory/BuildDispatcher.py
+++ b/imagefactory/BuildDispatcher.py
@@ -208,7 +208,8 @@ class BuildDispatcher(Singleton):
# provider semantics, per target:
# - ec2: region, one of ec2-us-east-1, ec2-us-west-1, ec2-ap-southeast-1,
ec2-ap-northeast-1, ec2-eu-west-1
# - condorcloud: ignored
- # - rhev-m: a key in /etc/rhevm.json and passed to op=register&site=provider
+ # - rhevm: a key in /etc/rhevm.json and passed to op=register&site=provider
+ # - vpshere: a key in /etc/vmware.json
# - mock: any provider with 'mock' prefix
# - rackspace: provider is rackspace
#
@@ -218,9 +219,9 @@ class BuildDispatcher(Singleton):
elif provider == 'rackspace':
return 'rackspace'
elif self._is_dynamic_provider(provider, 'rhevm'):
- return 'rhev-m'
+ return 'rhevm'
elif self._is_dynamic_provider(provider, 'vmware'):
- return 'vmware'
+ return 'vsphere'
elif provider.startswith('mock'):
return 'mock'
else:
diff --git a/imagefactory/builders/BaseBuilder.py b/imagefactory/builders/BaseBuilder.py
index 3ac9b6b..d345444 100644
--- a/imagefactory/builders/BaseBuilder.py
+++ b/imagefactory/builders/BaseBuilder.py
@@ -109,11 +109,6 @@ class BaseBuilder(object):
self.template = Template(template)
else:
raise TypeError("template should be a string representation of UUID,
URL, or XML document...")
- # TODO: Any cleaner way to do this?
- if target == "rhevm":
- target="rhev-m"
- elif target == "vsphere":
- target="vmware"
self.target = target
self.target_id = None
self.provider = None
diff --git a/imagefactory/builders/FedoraBuilder.py
b/imagefactory/builders/FedoraBuilder.py
index 74fa1c6..f0d4c14 100644
--- a/imagefactory/builders/FedoraBuilder.py
+++ b/imagefactory/builders/FedoraBuilder.py
@@ -81,7 +81,7 @@ class FedoraBuilder(BaseBuilder):
# Reference vars - don't change these
# EC2 is a special case as it can be either and is set in the config file
- upload_clouds = [ "rhev-m", "vmware", "condorcloud" ]
+ upload_clouds = [ "rhevm", "vsphere", "condorcloud" ]
nonul_clouds = [ "rackspace", "gogrid" ]
def __init__(self, template, target):
@@ -198,7 +198,7 @@ class FedoraBuilder(BaseBuilder):
if self.target == "ec2":
self.log.info("Transforming image for use on EC2")
self.ec2_transform_image()
- elif self.target == "vmware":
+ elif self.target == "vsphere":
self.log.info("Transforming image for use on VMWare")
self.vmware_transform_image()
@@ -206,7 +206,7 @@ class FedoraBuilder(BaseBuilder):
self.log.debug("Storing Fedora image at %s..." %
(self.app_config['warehouse'], ))
# TODO: Revisit target_parameters for different providers
- if self.target in [ "condorcloud", "rhev-m" ]:
+ if self.target in [ "condorcloud", "rhevm" ]:
# TODO: Prune any unneeded elements
target_parameters=libvirt_xml
else:
@@ -969,9 +969,9 @@ class FedoraBuilder(BaseBuilder):
raise ImageFactoryException("Invalid or unspecified EC2 AMI type
in config file")
elif self.target == "condorcloud":
self.condorcloud_push_image_upload(target_image_id, provider,
credentials)
- elif self.target == "rhev-m":
+ elif self.target == "rhevm":
self.rhevm_push_image_upload(target_image_id, provider, credentials)
- elif self.target == "vmware":
+ elif self.target == "vsphere":
self.vmware_push_image_upload(target_image_id, provider, credentials)
else:
raise ImageFactoryException("Invalid upload push requested for
target (%s) and provider (%s)" % (self.target, provider))
--
1.7.4.4