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

This commit is contained in:
Jenkins 2015-08-25 13:24:41 +00:00 committed by Gerrit Code Review
commit 0496dc93f6
7 changed files with 34 additions and 17 deletions

View File

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

View File

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

View File

@ -159,7 +159,13 @@ $(ISOROOT)/isolinux/splash.jpg: $(SOURCE_DIR)/iso/isolinux/splash_community.jpg
endif
$(ISOROOT)/ks.cfg: $(call depv,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)
$(ISOROOT)/bootstrap_admin_node.sh: $(SOURCE_DIR)/iso/bootstrap_admin_node.docker.sh ; $(ACTION.COPY)
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))
# 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

View File

@ -135,7 +135,7 @@ $(BUILD_DIR)/packages/rpm/build.done: $(BUILD_DIR)/packages/rpm/repo.done
fuel_rpm_packages_late:=\
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)))

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}
%{!?release: %define release 1}

View File

@ -21,7 +21,7 @@ Requires: fuel-library7.0
Requires: fuelmenu >= %{version}
Requires: fuel-package-updates >= %{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: python-fuelclient >= %{version}
Requires: yum