From 94af15e2bbf55e8a303cae33725554f5e366530c Mon Sep 17 00:00:00 2001 From: Chris AtLee Date: Mon, 28 May 2018 13:58:47 -0400 Subject: [PATCH] Bug 1237182: Remove set_property(..., write_to_file) support r=tomprince,Callek Differential Revision: https://phabricator.services.mozilla.com/D1447 --HG-- extra : rebase_source : 9e25457f4846f568694d6e8cf38346adfe4401cf --- testing/mozharness/mozharness/mozilla/automation.py | 5 +---- .../mozharness/mozilla/building/buildbase.py | 10 ++++------ .../mozharness/mozharness/mozilla/testing/testbase.py | 5 ++--- testing/mozharness/scripts/desktop_l10n.py | 6 ++---- testing/mozharness/scripts/mobile_l10n.py | 7 +++---- 5 files changed, 12 insertions(+), 21 deletions(-) diff --git a/testing/mozharness/mozharness/mozilla/automation.py b/testing/mozharness/mozharness/mozilla/automation.py index c6938d88678c..6cb9eafe8eab 100644 --- a/testing/mozharness/mozharness/mozilla/automation.py +++ b/testing/mozharness/mozharness/mozilla/automation.py @@ -64,12 +64,9 @@ class AutomationMixin(object): if set_return_code: self.return_code = EXIT_STATUS_DICT[self.worst_status] - def set_property(self, prop_name, prop_value, write_to_file=False): + def set_property(self, prop_name, prop_value): self.info("Setting property %s to %s" % (prop_name, prop_value)) self.properties[prop_name] = prop_value - if write_to_file: - return self.dump_properties(prop_list=[prop_name], - file_name=prop_name) return self.properties[prop_name] def query_property(self, prop_name): diff --git a/testing/mozharness/mozharness/mozilla/building/buildbase.py b/testing/mozharness/mozharness/mozilla/building/buildbase.py index 21fceb18eea9..0527a99e5d94 100755 --- a/testing/mozharness/mozharness/mozilla/building/buildbase.py +++ b/testing/mozharness/mozharness/mozilla/building/buildbase.py @@ -840,7 +840,7 @@ or run without that action (ie: --no-{action})" buildid = generate_build_ID() if c.get('is_automation') or os.environ.get("TASK_ID"): - self.set_property('buildid', buildid, write_to_file=True) + self.set_property('buildid', buildid) self.buildid = buildid return self.buildid @@ -1104,7 +1104,7 @@ or run without that action (ie: --no-{action})" self.info(pprint.pformat(build_props)) for key, prop in build_props.iteritems(): if prop != 'UNKNOWN': - self.set_property(key, prop, write_to_file=True) + self.set_property(key, prop) else: self.info("No mach_build_properties.json found - not importing properties.") @@ -1155,9 +1155,7 @@ or run without that action (ie: --no-{action})" base_cmd + [prop['ini_name']], cwd=dirs['abs_obj_dir'], halt_on_failure=halt_on_failure, env=env ) - self.set_property(prop['prop_name'], - prop_val, - write_to_file=True) + self.set_property(prop['prop_name'], prop_val) if self.config.get('is_automation'): self.info("Verifying buildid from application.ini matches buildid " @@ -1321,7 +1319,7 @@ or run without that action (ie: --no-{action})" cwd=objdir, halt_on_failure=True, output_parser=parser) for prop in parser.matches: - self.set_property(prop, parser.matches[prop], write_to_file=True) + self.set_property(prop, parser.matches[prop]) upload_files_cmd = [ 'make', 'echo-variable-UPLOAD_FILES', diff --git a/testing/mozharness/mozharness/mozilla/testing/testbase.py b/testing/mozharness/mozharness/mozilla/testing/testbase.py index 7437e792642b..d5655a3aadf7 100755 --- a/testing/mozharness/mozharness/mozilla/testing/testbase.py +++ b/testing/mozharness/mozharness/mozilla/testing/testbase.py @@ -405,7 +405,7 @@ You can set this by specifying --test-url URL parent_dir=dirs['abs_work_dir'], error_level=FATAL) self.installer_path = os.path.realpath(source) - self.set_property("build_url", self.installer_url, write_to_file=True) + self.set_property("build_url", self.installer_url) def _download_and_extract_symbols(self): dirs = self.query_abs_dirs() @@ -428,8 +428,7 @@ You can set this by specifying --test-url URL if not self.symbols_path: self.symbols_path = os.path.join(dirs['abs_work_dir'], 'symbols') - self.set_property("symbols_url", self.symbols_url, - write_to_file=True) + self.set_property("symbols_url", self.symbols_url) if self.symbols_url: self.download_unpack(self.symbols_url, self.symbols_path) diff --git a/testing/mozharness/scripts/desktop_l10n.py b/testing/mozharness/scripts/desktop_l10n.py index a72688f2d29f..2a90c267c09d 100755 --- a/testing/mozharness/scripts/desktop_l10n.py +++ b/testing/mozharness/scripts/desktop_l10n.py @@ -474,7 +474,7 @@ class DesktopSingleLocale(LocalesMixin, ReleaseMixin, AutomationMixin, prop_value = "%s %s" % (prop_value, message) else: prop_value = message - self.set_property(prop_key, prop_value, write_to_file=True) + self.set_property(prop_key, prop_value) BaseScript.add_failure(self, locale, message=message, **kwargs) def query_failed_locales(self): @@ -488,9 +488,7 @@ class DesktopSingleLocale(LocalesMixin, ReleaseMixin, AutomationMixin, locales = self.query_locales() for locale in locales: self.locales_property.setdefault(locale, SUCCESS_STR) - self.set_property("locales", - json.dumps(self.locales_property), - write_to_file=True) + self.set_property("locales", json.dumps(self.locales_property)) # Actions {{{2 def pull(self): diff --git a/testing/mozharness/scripts/mobile_l10n.py b/testing/mozharness/scripts/mobile_l10n.py index 797e6a45d1e0..8db64d711517 100755 --- a/testing/mozharness/scripts/mobile_l10n.py +++ b/testing/mozharness/scripts/mobile_l10n.py @@ -343,7 +343,7 @@ class MobileSingleLocale(LocalesMixin, ReleaseMixin, prop_value = "%s %s" % (prop_value, message) else: prop_value = message - self.set_property(prop_key, prop_value, write_to_file=True) + self.set_property(prop_key, prop_value) MercurialScript.add_failure(self, locale, message=message, **kwargs) def summary(self): @@ -352,8 +352,7 @@ class MobileSingleLocale(LocalesMixin, ReleaseMixin, locales = self.query_locales() for locale in locales: self.locales_property.setdefault(locale, "Success") - self.set_property("locales", json.dumps(self.locales_property), - write_to_file=True) + self.set_property("locales", json.dumps(self.locales_property)) # Actions {{{2 def pull(self): @@ -557,7 +556,7 @@ class MobileSingleLocale(LocalesMixin, ReleaseMixin, 'dest': dirs['abs_tools_dir'], }] rev = self.vcs_checkout(**repos[0]) - self.set_property("tools_revision", rev, write_to_file=True) + self.set_property("tools_revision", rev) def query_apkfile_path(self, locale):