Add register service option to setup.py install

This commit is contained in:
Yue Zhang
2015-06-30 00:32:03 +08:00
parent e6a6a4b3fb
commit 8149b73f6b
3 changed files with 10 additions and 1 deletions
+1 -1
View File
@@ -73,7 +73,7 @@ class RunHandler(object):
try:
protocol.reportStatus(vmStatus)
except prot.ProtocolError as e:
logger.Error("Failed to report vm status: {0}", status)
logger.Error("Failed to report vm status: {0}", e)
time.sleep(25)
+7
View File
@@ -79,3 +79,10 @@ class SUSEOSUtil(SUSE11OSUtil):
super(SUSEOSUtil, self).__init__()
self.dhcpClientName = 'wickedd-dhcp4'
def RegisterAgentService(self):
return shellutil.Run("systemctl enable waagent", chk_err=False)
def UnregisterAgentService(self):
return shellutil.Run("systemctl disable waagent", chk_err=False)
+2
View File
@@ -115,6 +115,8 @@ class install(_install):
if self.register_service:
print "Register agent service"
OSUtil.RegisterAgentService()
print "Start agent service"
OSUtil.StartAgentService()
setuptools.setup(name=GuestAgentName,
version=GuestAgentVersion,