Merge "Add support for building ironic-python-agent ramdisk"
This commit is contained in:
commit
d77f5263e9
|
@ -69,11 +69,16 @@ class BuildOvercloudImage(command.Command):
|
|||
'delorean-rdo-management',
|
||||
]
|
||||
|
||||
AGENT_IMAGE_ELEMENT = [
|
||||
'ironic-agent',
|
||||
]
|
||||
|
||||
DEPLOY_IMAGE_ELEMENT = [
|
||||
'deploy-ironic'
|
||||
]
|
||||
|
||||
IMAGE_TYPES = [
|
||||
'agent-ramdisk',
|
||||
'deploy-ramdisk',
|
||||
'discovery-ramdisk',
|
||||
'fedora-user',
|
||||
|
@ -203,6 +208,12 @@ class BuildOvercloudImage(command.Command):
|
|||
default=os.environ.get('FEDORA_USER_NAME', 'fedora-user'),
|
||||
help="Name of Fedora user image",
|
||||
)
|
||||
parser.add_argument(
|
||||
"--agent-name",
|
||||
dest="agent_name",
|
||||
default=os.environ.get('AGENT_NAME', 'ironic-python-agent'),
|
||||
help="Name of the IPA ramdisk image",
|
||||
)
|
||||
parser.add_argument(
|
||||
"--deploy-name",
|
||||
dest="deploy_name",
|
||||
|
@ -215,6 +226,14 @@ class BuildOvercloudImage(command.Command):
|
|||
default=os.environ.get('DISCOVERY_NAME', 'discovery-ramdisk'),
|
||||
help="Name of discovery ramdisk image",
|
||||
)
|
||||
parser.add_argument(
|
||||
"--agent-image-element",
|
||||
dest="agent_image_element",
|
||||
default=os.environ.get(
|
||||
'AGENT_IMAGE_ELEMENT',
|
||||
" ".join(self.AGENT_IMAGE_ELEMENT)),
|
||||
help="DIB elements for the IPA image",
|
||||
)
|
||||
parser.add_argument(
|
||||
"--deploy-image-element",
|
||||
dest="deploy_image_element",
|
||||
|
@ -353,6 +372,28 @@ class BuildOvercloudImage(command.Command):
|
|||
self._build_image_ramdisk_deploy(parsed_args)
|
||||
self._build_image_ramdisk_discovery(parsed_args)
|
||||
|
||||
def _build_image_ramdisk_agent(self, parsed_args):
|
||||
# The ironic-agent element builds the ramdisk internally,
|
||||
# so we use disk image create instead of ramdisk image create.
|
||||
image_name = vars(parsed_args)["agent_name"]
|
||||
if (not os.path.isfile("%s.initramfs" % image_name) or
|
||||
not os.path.isfile("%s.vmlinuz" % image_name)):
|
||||
args = ("-a %(arch)s -o %(name)s "
|
||||
"%(node_dist)s %(image_element)s "
|
||||
"%(dib_common_elements)s 2>&1 | "
|
||||
"tee dib-agent-ramdisk.log" %
|
||||
{
|
||||
'arch': parsed_args.node_arch,
|
||||
'name': image_name,
|
||||
'node_dist': parsed_args.node_dist,
|
||||
'image_element':
|
||||
vars(parsed_args)["agent_image_element"],
|
||||
'dib_common_elements':
|
||||
parsed_args.dib_common_elements,
|
||||
})
|
||||
os.environ.update(parsed_args.dib_env_vars)
|
||||
self._disk_image_create(args)
|
||||
|
||||
def _build_image_ramdisk_deploy(self, parsed_args):
|
||||
self._build_image_ramdisk(parsed_args, 'deploy')
|
||||
|
||||
|
@ -418,6 +459,7 @@ class BuildOvercloudImage(command.Command):
|
|||
else:
|
||||
for image_type in parsed_args.image_types:
|
||||
{
|
||||
'agent-ramdisk': self._build_image_ramdisk_agent,
|
||||
'deploy-ramdisk': self._build_image_ramdisk_deploy,
|
||||
'discovery-ramdisk': self._build_image_ramdisk_discovery,
|
||||
'fedora-user': self._build_image_fedora_user,
|
||||
|
|
Loading…
Reference in New Issue