Commit 9543eafc authored by Ilias Tsitsimpis's avatar Ilias Tsitsimpis

snf-ci: Don't get the schema files from local repo

snf-ci used to find the schema files in the local repo and upload them
to the testing server. This is wrong since one can choose to test a
different branch that the one he has currently checked out, so snf-ci
will use the wrong schema files.

This patch fixes the above problem by instructing snf-ci to use the
schema files it finds in the repo cloned inside the testing server.
parent 71f3d114
......@@ -937,12 +937,17 @@ class SynnefoCI(object):
schema = self.config.get('Global', 'schema')
self.logger.debug("Will use \"%s\" schema" % _green(schema))
schema_dir = os.path.join(self.ci_dir, "schemas/%s" % schema)
if not (os.path.exists(schema_dir) and os.path.isdir(schema_dir)):
raise ValueError("Unknown schema: %s" % schema)
self.logger.debug("Upload schema files to server")
_put(os.path.join(schema_dir, "*"), "/etc/snf-deploy/")
self.logger.debug("Update schema files to server")
cmd = """
schema_dir="synnefo/ci/schemas/{0}"
if [ -d "$schema_dir" ]; then
cp "$schema_dir"/* /etc/snf-deploy/
else
echo "$schema_dir" does not exist
exit 1
fi
""".format(schema)
_run(cmd, False)
self.logger.debug("Change password in nodes.conf file")
cmd = """
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment