def _update_contacts_repo(self): if not self.config["NO_GIT"]: parent = os.path.dirname(self.config["CONTACT_DATA_DIR"]) os.makedirs(parent, mode=0o700, exist_ok=True) ok = git_clone_or_pull(self.config["CONTACT_DATA_REPO"], self.config["CONTACT_DATA_DIR"], self.config["CONTACT_DATA_BRANCH"], self.config["GIT_SSH_KEY"]) if ok: app.logger.debug("contact repo update ok") else: app.logger.warning("contact repo update failed") return False if not os.path.exists(self.contacts_file): app.logger.error("%s not in contact repo", self.contacts_file) return False return True
def _update_topology_repo(self): if not self.config["NO_GIT"]: parent = os.path.dirname(self.config["TOPOLOGY_DATA_DIR"]) os.makedirs(parent, mode=0o755, exist_ok=True) ok = git_clone_or_pull(self.config["TOPOLOGY_DATA_REPO"], self.config["TOPOLOGY_DATA_DIR"], self.config["TOPOLOGY_DATA_BRANCH"]) if ok: app.logger.debug("topology repo update ok") else: app.logger.warning("topology repo update failed") return False for d in [self.projects_dir, self.topology_dir, self.vos_dir]: if not os.path.exists(d): app.logger.error("%s not in topology repo", d) return False return True
def _update_topology_repo(self): if not self.config["NO_GIT"]: parent = os.path.dirname(self.topology_data_dir) os.makedirs(parent, mode=0o755, exist_ok=True) ok = common.git_clone_or_pull(self.topology_data_repo, self.topology_data_dir, self.topology_data_branch) if ok: log.debug("topology repo update ok") else: log.error("topology repo update failed") return False for d in [self.projects_dir, self.topology_dir, self.vos_dir]: if not os.path.exists(d): log.error("%s not in topology repo", d) return False return True