Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[cueadmin] Minor fixes to cueadmin #1507

Merged
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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
4 changes: 2 additions & 2 deletions cueadmin/tests/output_tests.py
Original file line number Diff line number Diff line change
Expand Up @@ -213,8 +213,8 @@ def testDisplaySubscriptions(self, getStubMock):
self.assertEqual(
'Subscriptions for showName\n'
'Allocation Show Size Burst Run Used\n'
'local.general showName 1000 1500 500.00 50.00%\n'
'cloud.desktop showName 0 1500 50.00 5000.00%\n',
'local.general showName 10.0 15.0 5.00 50.00%\n'
'cloud.desktop showName 0.0 15.0 0.50 0.50%\n',
out.getvalue())

def testDisplayJobs(self, getStubMock):
Expand Down
Loading