def update_manifest(self, manifest_path, tests_path, url_base="/", recreate=False, download=False): self.logger.info("Updating test manifest %s" % manifest_path) manifest_log.setup() json_data = None if download: # TODO: make this not github-specific download_from_github(manifest_path, tests_path) if not recreate: try: with open(manifest_path) as f: json_data = json.load(f) except IOError: #If the existing file doesn't exist just create one from scratch pass if not json_data: manifest_file = manifest.Manifest(url_base) else: try: manifest_file = manifest.Manifest.from_json(tests_path, json_data) except manifest.ManifestVersionMismatch: manifest_file = manifest.Manifest(url_base) manifest_update.update(tests_path, manifest_file, True) manifest.write(manifest_file, manifest_path)
def update_manifest(self, manifest_path, tests_path, url_base="/", recreate=False, download=False): self.logger.info("Updating test manifest %s" % manifest_path) manifest_log.setup() json_data = None if download: # TODO: make this not github-specific download_from_github(manifest_path, tests_path) if not recreate: try: with open(manifest_path) as f: json_data = json.load(f) except IOError: self.logger.info("Unable to find test manifest") except ValueError: self.logger.info("Unable to parse test manifest") if not json_data: self.logger.info("Creating test manifest") manifest_file = manifest.Manifest(url_base) else: try: manifest_file = manifest.Manifest.from_json(tests_path, json_data) except manifest.ManifestVersionMismatch: manifest_file = manifest.Manifest(url_base) manifest_update.update(tests_path, manifest_file, True) manifest.write(manifest_file, manifest_path)
def update_manifest(self, manifest_path, tests_path, url_base="/", recreate=False, download=False): self.logger.info("Updating test manifest %s" % manifest_path) manifest_log.setup() json_data = None if download: # TODO: make this not github-specific download_from_github(manifest_path, tests_path) if not recreate: try: with open(manifest_path) as f: json_data = json.load(f) except IOError: #If the existing file doesn't exist just create one from scratch pass if not json_data: manifest_file = manifest.Manifest(url_base) else: try: manifest_file = manifest.Manifest.from_json( tests_path, json_data) except manifest.ManifestVersionMismatch: manifest_file = manifest.Manifest(url_base) manifest_update.update(tests_path, manifest_file, True) manifest.write(manifest_file, manifest_path)