mirror of
https://github.com/clearlinux/WALinuxAgent.git
synced 2026-09-06 22:01:34 +00:00
Add code to eject dvd inside guest vm
This commit is contained in:
@@ -342,6 +342,11 @@ class DefaultOSUtil(object):
|
||||
retcode = self.umount(mount_point, chk_err=chk_err)
|
||||
if chk_err and retcode != 0:
|
||||
raise OSUtilError("Failed to umount dvd.")
|
||||
|
||||
def eject_dvd(self, chk_err=True):
|
||||
retcode = shellutil.run("eject")
|
||||
if chk_err and retcode != 0:
|
||||
raise OSUtilError("Failed to eject dvd")
|
||||
|
||||
def load_atappix_mod(self):
|
||||
if self.is_atapiix_mod_loaded():
|
||||
|
||||
@@ -59,6 +59,7 @@ def copy_ovf_env():
|
||||
ovf_file_path = os.path.join(OSUTIL.get_lib_dir(), OVF_FILE_NAME)
|
||||
fileutil.write_file(ovf_file_path, ovfxml)
|
||||
OSUTIL.umount_dvd()
|
||||
OSUTIL.eject_dvd()
|
||||
except IOError as e:
|
||||
raise ProtocolError(text(e))
|
||||
except OSUtilError as e:
|
||||
|
||||
@@ -22,8 +22,9 @@ import azurelinuxagent.utils.restutil as restutil
|
||||
from azurelinuxagent.protocol.common import *
|
||||
|
||||
ENDPOINT='169.254.169.254'
|
||||
APIVERSION='2015-05-01-preview'
|
||||
#TODO use http for azure pack test
|
||||
#ENDPOINT='localhost'
|
||||
APIVERSION='2015-05-01-preview'
|
||||
BASE_URI = "http://{0}/Microsoft.Compute/{1}?api-version={{{2}}}{3}"
|
||||
|
||||
def _add_content_type(headers):
|
||||
|
||||
Reference in New Issue
Block a user