Skip to content

Commit

Permalink
Merge pull request #6 from peusebiu/apic
Browse files Browse the repository at this point in the history
Apic
  • Loading branch information
eusebiu-constantin-petu-dbk authored Jan 29, 2019
2 parents e0577f5 + 3bfb23a commit f2bf517
Show file tree
Hide file tree
Showing 3 changed files with 10 additions and 5 deletions.
4 changes: 2 additions & 2 deletions Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -75,8 +75,8 @@ servedocs: docs
watchmedo shell-command -p '*.rst' -c '$(MAKE) -C docs html' -R -D .

release: clean
python setup.py sdist upload
python setup.py bdist_wheel upload
python setup.py sdist upload -r http://aci-docker-reg.cisco.com/artifactory/api/pypi/atom-pypi
python setup.py bdist_wheel upload -r http://aci-docker-reg.cisco.com/artifactory/api/pypi/atom-pypi

dist: clean
python setup.py sdist -r http://aci-docker-reg.cisco.com/artifactory/api/pypi/atom-pypi
Expand Down
1 change: 0 additions & 1 deletion imcsdk/apis/server/vmedia.py
Original file line number Diff line number Diff line change
Expand Up @@ -415,7 +415,6 @@ def vmedia_mount_remove_all(handle, server_id=1):
if virt_media.get_class_id() == "CommSavedVMediaMap":
virt_media.admin_action = CommSavedVMediaMapConsts.ADMIN_ACTION_DELETE_VOLUME
handle.set_mo(virt_media)
# Remove the mapped ISO
elif virt_media.get_class_id() == "CommVMediaMap":
handle.remove_mo(virt_media)

Expand Down
10 changes: 8 additions & 2 deletions imcsdk/apis/v2/server/vmedia.py
Original file line number Diff line number Diff line change
Expand Up @@ -414,14 +414,20 @@ def vmedia_mount_remove_all(handle, server_id=1):
Examples:
vmedia_mount_remove_all(handle)
"""
from imcsdk.mometa.comm.CommSavedVMediaMap import CommSavedVMediaMapConsts

# Get all current virtually mapped ISOs
virt_media_maps = handle.query_children(in_dn=_get_vmedia_mo_dn(handle,
server_id))
# Loop over each mapped ISO
for virt_media in virt_media_maps:
# Remove the mapped ISO
handle.remove_mo(virt_media)
# Remove the saved mapping
if virt_media.get_class_id() == 'CommSavedVMediaMap':
virt_media.admin_action = CommSavedVMediaMapConsts.ADMIN_ACTION_DELETE_VOLUME
handle.set_mo(virt_media)
elif virt_media.get_class_id() == 'CommVMediaMap':
handle.remove_mo(virt_media)

# Raise error if all mappings not removed
if len(handle.query_children(in_dn="sys/svc-ext/vmedia-svc")) > 0:
raise ImcOperationError('Remove Virtual Media',
Expand Down

0 comments on commit f2bf517

Please sign in to comment.