Skip to content

Commit

Permalink
Minor fixes to cueadmin
Browse files Browse the repository at this point in the history
Fix issue when accessing pycue grpc objects and properly convert core values on displaySubscriptions
  • Loading branch information
DiegoTavares committed Sep 6, 2024
1 parent 13087f3 commit a88f417
Show file tree
Hide file tree
Showing 2 changed files with 10 additions and 7 deletions.
6 changes: 3 additions & 3 deletions cueadmin/cueadmin/common.py
Original file line number Diff line number Diff line change
Expand Up @@ -410,18 +410,18 @@ def dropAllDepends(job, layer=None, frame=None):
logger.debug("dropping all depends on: %s/%04d-%s", job, layer, frame)
depend_er_frame = opencue.api.findFrame(job, layer, frame)
for depend in depend_er_frame.getWhatThisDependsOn():
depend.proxy.satisfy()
depend.satisfy()
elif layer:
logger.debug("dropping all depends on: %s/%s", job, layer)
depend_er_layer = opencue.api.findLayer(job, layer)
for depend in depend_er_layer.getWhatThisDependsOn():
depend.proxy.satisfy()
depend.satisfy()
else:
logger.debug("dropping all depends on: %s", job)
depend_er_job = opencue.api.findJob(job)
for depend in depend_er_job.getWhatThisDependsOn():
logger.debug("dropping depend %s %s", depend.data.type, opencue.id(depend))
depend.proxy.satisfy()
depend.satisfy()


class Convert(object):
Expand Down
11 changes: 7 additions & 4 deletions cueadmin/cueadmin/output.py
Original file line number Diff line number Diff line change
Expand Up @@ -141,16 +141,19 @@ def displaySubscriptions(subscriptions, show):
sub_format = "%-30s %-12s %6s %8s %8s %8s"
print(sub_format % ("Allocation", "Show", "Size", "Burst", "Run", "Used"))
for s in subscriptions:
size = s.data.size/100
burst = s.data.burst/100
run = s.data.reserved_cores/100
if s.data.size:
perc = float(s.data.reserved_cores) / s.data.size * 100.0
else:
perc = s.data.reserved_cores * 100.0
perc = run

print(sub_format % (s.data.allocation_name,
s.data.show_name,
s.data.size,
s.data.burst,
"%0.2f" % s.data.reserved_cores,
size,
burst,
"%0.2f" % run,
"%0.2f%%" % perc))


Expand Down

0 comments on commit a88f417

Please sign in to comment.