mirror of
https://pagure.io/fedora-infra/ansible.git
synced 2026-04-23 10:01:28 +08:00
distgit: Add some logs when hardlinks are made
This commit is contained in:
@@ -66,7 +66,7 @@ def check_auth(username):
|
||||
return authenticated
|
||||
|
||||
|
||||
def hardlink(src, dest):
|
||||
def hardlink(src, dest, username):
|
||||
try:
|
||||
os.makedirs(os.path.dirname(dest))
|
||||
|
||||
@@ -85,6 +85,8 @@ def hardlink(src, dest):
|
||||
os.unlink(dest)
|
||||
os.link(src, dest)
|
||||
|
||||
print >> sys.stderr, "[username=%s] ln %s %s" % (username, src, dest)
|
||||
|
||||
|
||||
def main():
|
||||
os.umask(002)
|
||||
@@ -169,7 +171,7 @@ def main():
|
||||
elif action == 'check':
|
||||
if os.path.exists(old_path):
|
||||
# The file had been uploaded at the old path
|
||||
hardlink(old_path, dest_file)
|
||||
hardlink(old_path, dest_file, username)
|
||||
print 'Available'
|
||||
else:
|
||||
print 'Missing'
|
||||
@@ -217,7 +219,7 @@ def main():
|
||||
|
||||
# Add the file to the old path, where fedpkg is currently looking for it
|
||||
if hash_type == "md5":
|
||||
hardlink(dest_file, old_path)
|
||||
hardlink(dest_file, old_path, username)
|
||||
|
||||
# Emit a fedmsg message. Load the config to talk to the fedmsg-relay.
|
||||
try:
|
||||
|
||||
Reference in New Issue
Block a user