Revision 46a07468

b/ci/snf-ci
25 25
USAGE = """usage: %%prog [options] command
26 26

  
27 27
command:
28
    * %s Create the slave server
28
    * %s: Create the slave server
29 29
    * %s: Create debian packages for Synnefo in the created server
30 30
    * %s: Deploy Synnefo in created server
31 31
    * %s: Run Synnefo unittests
......
54 54
                      action="store_true", default=False,
55 55
                      help="Download the debian packages that were created"
56 56
                           " during the '%s' step." % BUILD_SYNNEFO_CMD)
57
    parser.add_option("--schema", dest="schema", default=None,
58
                      help="Schema for snf-deploy.")
57 59

  
58 60
    (options, args) = parser.parse_args()
59 61

  
......
91 93
    if options.fetch_packages:
92 94
        synnefo_ci.fetch_packages()
93 95
    if getattr(options, DEPLOY_SYNNEFO_CMD, False):
94
        synnefo_ci.deploy_synnefo()
96
        synnefo_ci.deploy_synnefo(schema=options.schema)
95 97
    if getattr(options, TEST_SYNNEFO_CMD, False):
96 98
        synnefo_ci.unit_test()
97 99
    if getattr(options, RUN_BURNIN_CMD, False):
b/ci/utils.py
429 429
        _run(cmd, False)
430 430

  
431 431
    @_check_fabric
432
    def deploy_synnefo(self):
432
    def deploy_synnefo(self, schema=None):
433 433
        """Deploy Synnefo using snf-deploy"""
434 434
        self.logger.info("Deploy Synnefo..")
435
        schema = self.config.get('Global', 'schema')
436
        schema_files = os.path.join(self.ci_dir, "schemas/%s/*" % schema)
435
        if schema is None:
436
            schema = self.config.get('Global', 'schema')
437 437
        self.logger.debug("Will use %s schema" % schema)
438 438

  
439
        schema_dir = os.path.join(self.ci_dir, "schemas/%s" % schema)
440
        if not (os.path.exists(schema_dir) and os.path.isdir(schema_dir)):
441
            raise ValueError("Unknown schema: %s" % schema)
442

  
439 443
        self.logger.debug("Upload schema files to server")
440 444
        with fabric.quiet():
441
            fabric.put(schema_files, "/etc/snf-deploy/")
445
            fabric.put(os.path.join(schema_dir, "*"), "/etc/snf-deploy/")
442 446

  
443 447
        self.logger.debug("Change password in nodes.conf file")
444 448
        cmd = """

Also available in: Unified diff