Bug 1076172 - Fix the case where we don't have .mozilla created and file permissions. r=armenzg
--- a/mozharness/mozilla/testing/testbase.py
+++ b/mozharness/mozilla/testing/testbase.py
@@ -160,22 +160,26 @@ class TestingMixin(VirtualenvMixin, Buil
self.credential_path = os.path.expanduser("~/.mozilla/credentials.cfg")
if (os.path.isfile(self.credential_path)):
fp = open(self.credential_path,'r')
content = fp.read().splitlines()
fp.close()
self.https_username = content[0].strip()
self.https_password = content[1].strip()
else:
+ if not os.path.exists(os.path.expanduser("~/.mozilla")):
+ os.makedirs(os.path.expanduser("~/.mozilla"))
self.https_username = raw_input("Please enter your full LDAP email address: ")
self.https_password = getpass.getpass()
fp = open(self.credential_path,"w+")
fp.write("%s\n" % self.https_username)
fp.write("%s\n" % self.https_password)
fp.close()
+ os.chmod(self.credential_path, 0600)
+
return self.https_username, self.https_password
def _pre_config_lock(self, rw_config):
for i, (target_file, target_dict) in enumerate(rw_config.all_cfg_files_and_dicts):
if 'developer_config' in target_file:
self._developer_mode_changes(rw_config)
def _developer_mode_changes(self, rw_config):