Add some debugging about ref updating
Signed-off-by: Patrick Uiterwijk <puiterwijk@redhat.com>
This commit is contained in:
parent
d3e701e10f
commit
4edf567bd4
@ -63,10 +63,13 @@ class Tree(OSTree):
|
|||||||
if self.extra_config:
|
if self.extra_config:
|
||||||
tag_ref = self.extra_config.get('tag_ref', True)
|
tag_ref = self.extra_config.get('tag_ref', True)
|
||||||
if not tag_ref:
|
if not tag_ref:
|
||||||
|
print('Not updating ref as configured')
|
||||||
return
|
return
|
||||||
ref = get_ref_from_treefile(self.treefile)
|
ref = get_ref_from_treefile(self.treefile)
|
||||||
commitid = get_commitid_from_commitid_file(self.commitid_file)
|
commitid = get_commitid_from_commitid_file(self.commitid_file)
|
||||||
|
print('Ref: %r, Commit ID: %r' % (ref, commitid))
|
||||||
if ref and commitid:
|
if ref and commitid:
|
||||||
|
print('Updating ref')
|
||||||
# Let's write the tag out ourselves
|
# Let's write the tag out ourselves
|
||||||
heads_dir = os.path.join(self.repo, 'refs', 'heads')
|
heads_dir = os.path.join(self.repo, 'refs', 'heads')
|
||||||
if not os.path.exists(heads_dir):
|
if not os.path.exists(heads_dir):
|
||||||
|
@ -37,8 +37,10 @@ def get_ref_from_treefile(treefile):
|
|||||||
try:
|
try:
|
||||||
parsed = json.loads(f.read())
|
parsed = json.loads(f.read())
|
||||||
ref = parsed['ref']
|
ref = parsed['ref']
|
||||||
except Exception:
|
except Exception as e:
|
||||||
pass
|
print('Unable to get ref from treefile: %s' % e)
|
||||||
|
else:
|
||||||
|
print('Unable to open treefile')
|
||||||
return ref
|
return ref
|
||||||
|
|
||||||
|
|
||||||
@ -48,6 +50,8 @@ def get_commitid_from_commitid_file(commitid_file):
|
|||||||
if os.path.isfile(commitid_file):
|
if os.path.isfile(commitid_file):
|
||||||
with open(commitid_file, 'r') as f:
|
with open(commitid_file, 'r') as f:
|
||||||
commitid = f.read().replace('\n', '')
|
commitid = f.read().replace('\n', '')
|
||||||
|
else:
|
||||||
|
print('Unable to find commitid file')
|
||||||
return commitid
|
return commitid
|
||||||
|
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user