Rename package to fuel-target-centos-images6.6

To support several Centos versions we need
both Centos6.5 and Centos6.6 images to be
in place. But during master node upgrade
we update fuel-target-centos-images package
and Centos6.5 images disappear. The case is
the same as for fuel-library.

Change-Id: I5b974593d2375bcc6367322fcf182f3dcc006d05
Closes-Bug: #1485527
This commit is contained in:
Vladimir Kozhukalov 2015-08-19 17:00:07 +03:00
parent c9dad194e8
commit b86f4b1462
7 changed files with 34 additions and 17 deletions

View File

@ -22,17 +22,23 @@ from jinja2 import Environment
class KickstartFile(object): class KickstartFile(object):
def __init__(self, config_filename, template_filename): def __init__(self, template_file, config_file=None, config_data=None):
with open(config_filename, "r") as f: self.config = {}
self.config = yaml.load(f.read())
if config_file:
with open(config_file, "r") as f:
self.config.update(yaml.safe_load(f.read()))
if config_data:
self.config.update(yaml.safe_load(config_data))
self.env = Environment( self.env = Environment(
loader=FileSystemLoader( loader=FileSystemLoader(
os.path.dirname(os.path.abspath(template_filename)) os.path.dirname(os.path.abspath(template_file))
) )
) )
self.template = self.env.get_template( self.template = self.env.get_template(
os.path.basename(os.path.abspath(template_filename)) os.path.basename(os.path.abspath(template_file))
) )
def render(self): def render(self):
@ -50,12 +56,16 @@ if __name__ == "__main__":
parser = argparse.ArgumentParser(epilog=description) parser = argparse.ArgumentParser(epilog=description)
parser.add_argument( parser.add_argument(
'-t', '--template', dest='template', action='store', type=str, '-t', '--template-file', dest='template_file', action='store',
help='kickstart template file', required=True type=str, help='kickstart template file', required=True
) )
parser.add_argument( parser.add_argument(
'-c', '--config', dest='config', action='store', type=str, '-c', '--config-file', dest='config_file', action='store', type=str,
help='yaml config file', required=True help='yaml config file', required=False, default=None
)
parser.add_argument(
'-u', '--config-data', dest='config_data', action='store', type=str,
help='yaml config input', default='{}'
) )
parser.add_argument( parser.add_argument(
'-o', '--output', dest='output', action='store', type=str, '-o', '--output', dest='output', action='store', type=str,
@ -64,8 +74,9 @@ if __name__ == "__main__":
params, other_params = parser.parse_known_args() params, other_params = parser.parse_known_args()
ks = KickstartFile( ks = KickstartFile(
config_filename=params.config, template_file=params.template_file,
template_filename=params.template config_file=params.config_file,
config_data=params.config_data
) )
if params.output == '-': if params.output == '-':

View File

@ -253,7 +253,7 @@ docker-io
fuel-bootstrap-image fuel-bootstrap-image
fuel-bootstrap-image-builder fuel-bootstrap-image-builder
fuel-createmirror fuel-createmirror
fuel-target-centos-images fuel-target-centos-images{{CENTOS_RELEASE}}
fuel-package-updates fuel-package-updates
fuelmenu fuelmenu
fuel-docker-images fuel-docker-images

View File

@ -159,7 +159,13 @@ $(ISOROOT)/isolinux/splash.jpg: $(SOURCE_DIR)/iso/isolinux/splash_community.jpg
endif endif
$(ISOROOT)/ks.cfg: $(call depv,KSYAML) $(ISOROOT)/ks.cfg: $(call depv,KSYAML)
$(ISOROOT)/ks.cfg: $(SOURCE_DIR)/iso/ks.template $(SOURCE_DIR)/iso/ks.py $(KSYAML) $(ISOROOT)/ks.cfg: $(SOURCE_DIR)/iso/ks.template $(SOURCE_DIR)/iso/ks.py $(KSYAML)
python $(SOURCE_DIR)/iso/ks.py -t $(SOURCE_DIR)/iso/ks.template -c $(KSYAML) -o $@ python $(SOURCE_DIR)/iso/ks.py \
-t $(SOURCE_DIR)/iso/ks.template \
-c $(KSYAML) \
-u '{"CENTOS_RELEASE": "$(CENTOS_RELEASE)"}' \
-o $@.tmp
mv $@.tmp $@
ifeq ($(PRODUCTION),docker) ifeq ($(PRODUCTION),docker)
$(ISOROOT)/bootstrap_admin_node.sh: $(SOURCE_DIR)/iso/bootstrap_admin_node.docker.sh ; $(ACTION.COPY) $(ISOROOT)/bootstrap_admin_node.sh: $(SOURCE_DIR)/iso/bootstrap_admin_node.docker.sh ; $(ACTION.COPY)
else else

View File

@ -145,7 +145,7 @@ $(eval $(call prepare_file_source,fuel-bootstrap-image,initramfs.img,$(BUILD_DIR
$(eval $(call prepare_file_source,fuel-bootstrap-image,bootstrap.rsa,$(SOURCE_DIR)/bootstrap/ssh/id_rsa,$(SOURCE_DIR)/bootstrap/ssh/id_rsa)) $(eval $(call prepare_file_source,fuel-bootstrap-image,bootstrap.rsa,$(SOURCE_DIR)/bootstrap/ssh/id_rsa,$(SOURCE_DIR)/bootstrap/ssh/id_rsa))
# fuel-target-centos-images sources # fuel-target-centos-images sources
$(eval $(call prepare_file_source,fuel-target-centos-images,fuel-target-centos-images.tar,$(BUILD_DIR)/images/$(TARGET_CENTOS_IMG_ART_NAME),$(BUILD_DIR)/images/$(TARGET_CENTOS_IMG_ART_NAME))) $(eval $(call prepare_file_source,fuel-target-centos-images$(CENTOS_RELEASE),fuel-target-centos-images$(CENTOS_RELEASE).tar,$(BUILD_DIR)/images/$(TARGET_CENTOS_IMG_ART_NAME),$(BUILD_DIR)/images/$(TARGET_CENTOS_IMG_ART_NAME)))
.PHONY: packages-late packages-rpm-late .PHONY: packages-late packages-rpm-late

View File

@ -134,7 +134,7 @@ $(BUILD_DIR)/packages/rpm/build.done: $(BUILD_DIR)/packages/rpm/repo.done
fuel_rpm_packages_late:=\ fuel_rpm_packages_late:=\
fuel-bootstrap-image \ fuel-bootstrap-image \
fuel-target-centos-images fuel-target-centos-images$(CENTOS_RELEASE)
$(eval $(foreach pkg,$(fuel_rpm_packages_late),$(call build_rpm,$(pkg),-late)$(NEWLINE))) $(eval $(foreach pkg,$(fuel_rpm_packages_late),$(call build_rpm,$(pkg),-late)$(NEWLINE)))

View File

@ -1,4 +1,4 @@
%define name fuel-target-centos-images %define name fuel-target-centos-images6.6
%{!?version: %define version 7.0.0} %{!?version: %define version 7.0.0}
%{!?release: %define release 1} %{!?release: %define release 1}

View File

@ -21,7 +21,7 @@ Requires: fuel-library7.0
Requires: fuelmenu >= %{version} Requires: fuelmenu >= %{version}
Requires: fuel-package-updates >= %{version} Requires: fuel-package-updates >= %{version}
Requires: fuel-provisioning-scripts >= %{version} Requires: fuel-provisioning-scripts >= %{version}
Requires: fuel-target-centos-images >= %{version} Requires: fuel-target-centos-images6.6 >= %{version}
Requires: nailgun-net-check >= %{version} Requires: nailgun-net-check >= %{version}
Requires: python-fuelclient >= %{version} Requires: python-fuelclient >= %{version}
Requires: yum Requires: yum