mirror of
https://github.com/clearlinux/WALinuxAgent.git
synced 2026-09-06 22:01:34 +00:00
change hard code wala configure path to MyDistro.getConfigurationPath() and ignore exception when get ctime of the configure file
This commit is contained in:
@@ -5195,10 +5195,15 @@ class Agent(Util):
|
||||
if provisionError == None :
|
||||
provisioned = True
|
||||
SetFileContents(LibDir + "/provisioned", "")
|
||||
lastCtime = os.path.getctime("/etc/waagent.conf")
|
||||
lastCtime = "NOTFIND"
|
||||
try:
|
||||
walaConfigFile = MyDistro.getConfigurationPath()
|
||||
lastCtime = time.ctime(os.path.getctime(walaConfigFile))
|
||||
except:
|
||||
pass
|
||||
#Get Ctime of wala config, can help identify the base image of this VM
|
||||
AddExtensionEvent(name="WALA",op=WALAEventOperation.Provision,isSuccess=True,
|
||||
message="WALA Config Ctime:"+time.ctime(lastCtime))
|
||||
message="WALA Config Ctime:"+lastCtime)
|
||||
|
||||
#
|
||||
# only one port supported
|
||||
@@ -5504,7 +5509,7 @@ def Deprovision(force, deluser):
|
||||
"""
|
||||
|
||||
#Append blank line at the end of file, so the ctime of this file is changed every time
|
||||
Run("echo ''>>"+"/etc/waagent.conf")
|
||||
Run("echo ''>>"+ MyDistro.getConfigurationPath())
|
||||
|
||||
SwitchCwd()
|
||||
ovfxml = GetFileContents(LibDir+"/ovf-env.xml")
|
||||
|
||||
Reference in New Issue
Block a user