Skip to content
Open
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
9 changes: 1 addition & 8 deletions py-libvirt/destroy_domains.py
Original file line number Diff line number Diff line change
Expand Up @@ -7,14 +7,7 @@ def destroy_domains():
'''
destroy all domains() via libvirt python API.
'''
conn = libvirt.open(None)
if conn:
for i in conn.listDomainsID():
dom = conn.lookupByID(i)
dom.destroy()
time.sleep(1)
if conn.listDomainsID():
print 'ERROR! there are live domains.'

else:
print 'Failed to open connection to the hypervisor'

Expand Down
7 changes: 1 addition & 6 deletions py2017/mutiprocessing_pool_return_value.py
Original file line number Diff line number Diff line change
Expand Up @@ -18,9 +18,4 @@ def exponent(name, x, y):
p = Pool(4)
results = [p.apply_async(exponent, args=(i, x, y))
for (i, x, y) in zip(range(10), range(10), range(10))]
print 'Waiting for all subprocesses done...'
p.close()
p.join()
print 'All subprocesses done.'
output = [r.get() for r in results]
print output