Esempio n. 1
0
    def check(self):
        """ Checks if all synergy resources are available. """
        PreparationAction.check(self)

        session = self.get_session()
        ccm_object = session.create(self._config.name)
        role = session.role
        co_role = ccm.get_role_for_status(session, ccm_object['status'])
        _logger.info("Try to switch user to role: %s" % co_role)
        session.role = co_role
        session.role = role
Esempio n. 2
0
    def execute(self):
        """ Updating the mentioned project. """

        session = self.get_session()
        ccmproject = session.create(self._config.name)
        role = session.role

        status = ccmproject['status']
        co_role = ccm.get_role_for_status(session, status)
        session.role = co_role

        if not self._config.get_boolean('use.reconfigure.template', False):
            _logger.info("Setting update properties to manual")
            ccmproject.set_update_method('manual', True)
            _logger.info("Cleaning up update properties")
            self._clean_update_properties(ccmproject)
            _logger.info("Setting update properties.")
            self._set_tasks_and_folders(ccmproject)
            _logger.info("Applying update properties.")
            ccmproject.apply_update_properties(baseline=False)
        replace_subprojects = True
        if not self._config.get_boolean('replace.subprojects', True):
            _logger.info("NOT replacing subprojects")
            replace_subprojects = False
        update_keepgoing = True
        if self._config.get_boolean('update.failonerror', False):
            _logger.info("The build will fail with update errors")
            update_keepgoing = False

        _logger.info("Updating %s..." % ccmproject.objectname)
        result = ccmproject.update(True, replace_subprojects, update_keepgoing, result=ccm.UpdateResultSimple(ccmproject.session))
        ccm.log_result(result, ccm.UPDATE_LOG_RULES, _logger)
        
        self._sync(ccmproject)
        
        self._check_conflicts(ccmproject)
        
        session.role = role