예제 #1
0
 def wrapper(*args, **kwargs):
     result = func(*args, **kwargs)
     try:
         if settings.UPLOAD_PATCHSET:
             if not settings.GERRIT_REFSPEC:
                 raise ValueError('REFSPEC should be set for CI tests.')
             logger.info("Uploading new patchset from {0}"
                         .format(settings.GERRIT_REFSPEC))
             remote = SSHClient(args[0].admin_node_ip,
                                username='******',
                                password='******')
             remote.upload(settings.PATCH_PATH.rstrip('/'),
                           '/tmp/fuel-ostf')
             remote.execute('source /opt/fuel_plugins/ostf/bin/activate; '
                            'cd /tmp/fuel-ostf; python setup.py develop')
             remote.execute('/etc/init.d/supervisord restart')
             helpers.wait(
                 lambda: "RUNNING" in
                 remote.execute("supervisorctl status ostf | awk\
                                '{print $2}'")['stdout'][0],
                 timeout=60)
             logger.info("OSTF status: RUNNING")
     except Exception as e:
         logger.error("Could not upload patch set {e}".format(e=e))
         raise
     return result
예제 #2
0
 def wrapper(*args, **kwargs):
     result = func(*args, **kwargs)
     try:
         if settings.UPLOAD_PATCHSET:
             if not settings.GERRIT_REFSPEC:
                 raise ValueError('REFSPEC should be set for CI tests.')
             logger.info("Uploading new patchset from {0}"
                         .format(settings.GERRIT_REFSPEC))
             remote = SSHClient(args[0].admin_node_ip,
                                username='******',
                                password='******')
             remote.upload(settings.PATCH_PATH.rstrip('/'),
                           '/tmp/fuel-ostf')
             remote.execute('source /opt/fuel_plugins/ostf/bin/activate; '
                            'cd /tmp/fuel-ostf; python setup.py develop')
             remote.execute('/etc/init.d/supervisord restart')
             helpers.wait(
                 lambda: "RUNNING" in
                 remote.execute("supervisorctl status ostf | awk\
                                '{print $2}'")['stdout'][0],
                 timeout=60)
             logger.info("OSTF status: RUNNING")
     except Exception as e:
         logger.error("Could not upload patch set {e}".format(e=e))
         raise
     return result
예제 #3
0
 def wrapper(*args, **kwargs):
     result = func(*args, **kwargs)
     try:
         if UPLOAD_MANIFESTS:
             logging.info("Uploading new manifests from %s" %
                          UPLOAD_MANIFESTS_PATH)
             remote = SSHClient(args[0].get_admin_node_ip(),
                                username='******',
                                password='******')
             remote.execute('rm -rf /etc/puppet/modules/*')
             remote.upload(UPLOAD_MANIFESTS_PATH, '/etc/puppet/modules/')
             logging.info("Copying new site.pp from %s" %
                          SITEPP_FOR_UPLOAD)
             remote.execute("cp %s /etc/puppet/manifests" %
                            SITEPP_FOR_UPLOAD)
     except:
         logging.error("Could not upload manifests")
         raise
     return result
예제 #4
0
    def prepare_release(self):
        """Prepare master node

        Scenario:
            1. Revert snapshot "empty"
            2. Download the release if needed. Uploads custom manifest.

        Snapshot: ready

        """
        self.check_run("ready")
        self.env.revert_snapshot("empty")

        if OPENSTACK_RELEASE == OPENSTACK_RELEASE_REDHAT:
            self.fuel_web.update_redhat_credentials()
            self.fuel_web.assert_release_state(
                OPENSTACK_RELEASE_REDHAT,
                state='available'
            )

        try:
            if UPLOAD_MANIFESTS:
                logging.info("Uploading new manifests from %s" %
                             UPLOAD_MANIFESTS_PATH)
                remote = SSHClient(self.env.get_admin_node_ip(),
                                   username='******',
                                   password='******')
                remote.execute('rm -rf /etc/puppet/modules/*')
                remote.upload(UPLOAD_MANIFESTS_PATH, '/etc/puppet/modules/')
                logging.info("Copying new site.pp from %s" %
                             SITEPP_FOR_UPLOAD)
                remote.execute("cp %s /etc/puppet/manifests" %
                               SITEPP_FOR_UPLOAD)
        except:
            logging.error("Could not upload manifests")
            raise
        self.env.make_snapshot("ready")