def from_params(self, _app, _app_clean, _method, _commit_id, _hostname, _is_firstrun=False): """populate application from params""" self._deployment_method = self.__deployment_mng.get_deployment_method( _method) if not self._deployment_method: logger.errorout("Deployment method for app invalid", app=_app, method=_method) self.app = _app self.app_clean = _app_clean self.source_hostname = _hostname self.method_info = self._deployment_method.data.copy() self._commit_id = None if _commit_id == 'N/A' or len( _commit_id) == 0 else _commit_id self.is_firstrun = _is_firstrun self.track = self.__repo_mng.track self.status = consts.META_APP_UNCHANGED self.updated = False self.app_creation_datetime = helpers.get_utc() self.content_type = helpers.get_update_str(False) return self
def __init__(self, _repo_mng, _deployment_mng, *args): """Init of a application object""" self.__repo_mng = _repo_mng self.__deployment_mng = _deployment_mng num_args = len(args) self.commit_log = None self.content_type = helpers.get_update_str(False) self.repo_source = None if num_args > 0: if num_args == 1: self.from_object(args[0]) else: self.from_params(*args)
def update_content_type(self, isupdate): """Change content type flag to updated or list""" self.content_type = helpers.get_update_str(isupdate)