From 76199dbcd11efd24e9e2d195d2e0e85365e4790e Mon Sep 17 00:00:00 2001 From: Ekaterina Fedorova Date: Wed, 23 Oct 2013 19:58:40 +0400 Subject: [PATCH] Enable relative path for service manifest Change-Id: I5fc5edd9abe0c4915d26282d5e71f6b80f437b28 --- AUTHORS | 3 +- ChangeLog | 44 +++++++++++++++++++++++++++++- Services/ad-manifest.yaml | 2 +- etc/murano-repository.conf | 10 ++++--- muranorepository/cmd/run.py | 5 ++-- muranorepository/utils/archiver.py | 9 ++++-- 6 files changed, 61 insertions(+), 12 deletions(-) diff --git a/AUTHORS b/AUTHORS index 1ff8275..e5d4cc1 100644 --- a/AUTHORS +++ b/AUTHORS @@ -1,3 +1,4 @@ efedorova Ekaterina Fedorova -EkaterinaFedorova \ No newline at end of file +EkaterinaFedorova +Timur Sufiev \ No newline at end of file diff --git a/ChangeLog b/ChangeLog index ce0613c..ce6afa6 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,9 +1,51 @@ -commit 5fbab4294125e6258e7e5c961522170214d5558d +commit 9cf280bdedc56a320ea60ca40b0bf54127aa0e4e +Author: Ekaterina Fedorova +Date: Wed Oct 23 19:58:40 2013 +0400 + + Enable relative path for service manifest + + Change-Id: I5fc5edd9abe0c4915d26282d5e71f6b80f437b28 + +commit c6a3f103ffc84aecca13ff2cc47274cbfdd464c1 +Author: Ekaterina Fedorova +Date: Tue Oct 22 15:40:46 2013 +0400 + + Fix bugs + + 1) Handle hash_sum = None situation + 2) Add workflows to horizon archive + + Change-Id: Ie44e43bdabab239fbdfdcaae90c533f663041dd3 + +commit d121a4195342fe3d9517a6f8f6176372d2e62ee9 +Author: Timur Sufiev +Date: Mon Oct 21 20:48:28 2013 +0400 + + Implement server-side caching. + + For the beginning, let's place server package cache into + muranorepository/api dir (this path can be easily got with + v1_api.root_path). + + Change-Id: I7acbb174491f153eb340efb92ed3b0ce4c5f840f + Implements-feature: MRN-1149 + +commit b6613f9ecb5b90baf070f5c581a218d503b47e19 +Author: Timur Sufiev +Date: Mon Oct 21 16:36:13 2013 +0400 + + Add authentication against Keystone. + + Change-Id: Ifb581cc809074354d7db1404c28561ec722cf0f0 + Implements-feature: MRN-1146. + +commit 367d90f116d399754436060ddb221539911c2211 Author: Ekaterina Fedorova Date: Mon Oct 21 11:45:08 2013 +0400 Add some unit tests + Refactor v1 api and archiver Change-Id: I193023dd8eca4f8cc665a29a6b86698bb38edc83 commit de388f5e64d887ff6b20790fb540c05ab43dacf7 diff --git a/Services/ad-manifest.yaml b/Services/ad-manifest.yaml index 18fc3ea..eaaa93e 100644 --- a/Services/ad-manifest.yaml +++ b/Services/ad-manifest.yaml @@ -21,7 +21,7 @@ workflows: heat: - Windows.template -agents: +agent: - SetPassword.template - CreatePrimaryDC.template - AskDnsIp.template diff --git a/etc/murano-repository.conf b/etc/murano-repository.conf index d80b25b..530ae7e 100644 --- a/etc/murano-repository.conf +++ b/etc/murano-repository.conf @@ -12,11 +12,13 @@ admin_password = swordfish admin_tenant_name = admin # Provide information about data types -# absolute path to manifest location(root directory) -manifests = /home/fervent/Projects/my_repo/Services +# absolute or relative path to manifest location(root directory) +# where absolute path starts with '/', +# while relative hasn't leading '/' and is prepended to the repository folder +manifests = Services # Parameter name corresponds to section in manifest file -# Parameter value corresponds to relative path to data type +# Parameter value corresponds to relative path inside folder with manifests ui = ui_forms workflows = workflows heat = heat_templates @@ -30,4 +32,4 @@ ui = service_forms workflows = workflows heat = templates/cf agent = templates/agent -scripts = templates/agent/script \ No newline at end of file +scripts = templates/agent/script diff --git a/muranorepository/cmd/run.py b/muranorepository/cmd/run.py index 03d5a16..88d79c6 100644 --- a/muranorepository/cmd/run.py +++ b/muranorepository/cmd/run.py @@ -49,7 +49,6 @@ def main(): config_files = [dev_conf] config.parse_configs(sys.argv[1:], config_files) - log.setup('muranorepository') app = server.make_app({ @@ -60,7 +59,9 @@ def main(): 'admin_password': cfg.CONF.admin_password, 'admin_tenant_name': cfg.CONF.admin_tenant_name }) - + if not os.path.isabs(config.CONF.manifests): + config.CONF.manifests = os.path.join(possible_topdir, + config.CONF.manifests) wsgi.server(eventlet.listen((cfg.CONF.host, cfg.CONF.port), backlog=500), app) diff --git a/muranorepository/utils/archiver.py b/muranorepository/utils/archiver.py index 89ecd42..fea30c1 100644 --- a/muranorepository/utils/archiver.py +++ b/muranorepository/utils/archiver.py @@ -77,7 +77,8 @@ class Archiver(object): log.error("Unable to delete temp directory: {0}".format(e)) hash_sum = self._get_hash(ARCHIVE_PKG_NAME) pkg_dir = os.path.join(cache_dir, hash_sum) - os.mkdir(pkg_dir) + if not os.path.exists(pkg_dir): + os.mkdir(pkg_dir) shutil.move(ARCHIVE_PKG_NAME, os.path.join(pkg_dir, ARCHIVE_PKG_NAME)) return os.path.abspath(os.path.join(pkg_dir, ARCHIVE_PKG_NAME)) @@ -113,9 +114,11 @@ class Archiver(object): def create(self, client_type, cache_root, manifests, hash_sum, types): """ + client_type -- client asked for metadata + cache_root -- directory where cache is stored manifests -- list of Manifest objects - *types - desired data types to be added to archive - + hash_sum -- hash to compare to + types -- desired data types to be added to archive return: absolute path to created archive """ #TODO: temporary hack for mockfs