[MediaWiki-commits] [Gerrit] labstore: Fix use-before-reference properly - change (operations/puppet)
Yuvipanda has uploaded a new change for review. https://gerrit.wikimedia.org/r/227421 Change subject: labstore: Fix use-before-reference properly .. labstore: Fix use-before-reference properly Change-Id: Ibf68f08d7226650533804a07788d866530f0791e --- M modules/labstore/files/create-dbusers 1 file changed, 2 insertions(+), 3 deletions(-) git pull ssh://gerrit.wikimedia.org:29418/operations/puppet refs/changes/21/227421/1 diff --git a/modules/labstore/files/create-dbusers b/modules/labstore/files/create-dbusers index e54ca3a..65d7af4 100755 --- a/modules/labstore/files/create-dbusers +++ b/modules/labstore/files/create-dbusers @@ -61,15 +61,14 @@ return users def write_user_file(self, path, content): +f = os.open(path, os.O_CREAT | os.O_WRONLY) try: -f = os.open(path, os.O_CREAT | os.O_WRONLY) os.write(f, content.encode('utf-8')) # uid == gid os.fchown(f, self.uid, self.uid) os.fchmod(f, 0o400) finally: -if f: -os.close(f) +os.close(f) class CredentialCreator: -- To view, visit https://gerrit.wikimedia.org/r/227421 To unsubscribe, visit https://gerrit.wikimedia.org/r/settings Gerrit-MessageType: newchange Gerrit-Change-Id: Ibf68f08d7226650533804a07788d866530f0791e Gerrit-PatchSet: 1 Gerrit-Project: operations/puppet Gerrit-Branch: production Gerrit-Owner: Yuvipanda ___ MediaWiki-commits mailing list MediaWiki-commits@lists.wikimedia.org https://lists.wikimedia.org/mailman/listinfo/mediawiki-commits
[MediaWiki-commits] [Gerrit] labstore: Fix use-before-reference properly - change (operations/puppet)
Yuvipanda has submitted this change and it was merged. Change subject: labstore: Fix use-before-reference properly .. labstore: Fix use-before-reference properly Change-Id: Ibf68f08d7226650533804a07788d866530f0791e --- M modules/labstore/files/create-dbusers 1 file changed, 2 insertions(+), 3 deletions(-) Approvals: Yuvipanda: Looks good to me, approved jenkins-bot: Verified diff --git a/modules/labstore/files/create-dbusers b/modules/labstore/files/create-dbusers index e54ca3a..65d7af4 100755 --- a/modules/labstore/files/create-dbusers +++ b/modules/labstore/files/create-dbusers @@ -61,15 +61,14 @@ return users def write_user_file(self, path, content): +f = os.open(path, os.O_CREAT | os.O_WRONLY) try: -f = os.open(path, os.O_CREAT | os.O_WRONLY) os.write(f, content.encode('utf-8')) # uid == gid os.fchown(f, self.uid, self.uid) os.fchmod(f, 0o400) finally: -if f: -os.close(f) +os.close(f) class CredentialCreator: -- To view, visit https://gerrit.wikimedia.org/r/227421 To unsubscribe, visit https://gerrit.wikimedia.org/r/settings Gerrit-MessageType: merged Gerrit-Change-Id: Ibf68f08d7226650533804a07788d866530f0791e Gerrit-PatchSet: 1 Gerrit-Project: operations/puppet Gerrit-Branch: production Gerrit-Owner: Yuvipanda Gerrit-Reviewer: Yuvipanda Gerrit-Reviewer: jenkins-bot <> ___ MediaWiki-commits mailing list MediaWiki-commits@lists.wikimedia.org https://lists.wikimedia.org/mailman/listinfo/mediawiki-commits