diff options
| author | Daniel Watkins <daniel.watkins@canonical.com> | 2016-09-13 16:11:47 +0100 |
|---|---|---|
| committer | usd-importer <ubuntu-server@lists.ubuntu.com> | 2016-09-14 10:39:12 +0000 |
| commit | 5009a9d0f3606fc08a80ec0d59076d8dc48d2f25 (patch) | |
| tree | ad67eef74c5208178950db6ee28195e2137fa713 /bin | |
| parent | 0f7cef5b52162d1ebb31a738bd8fc9febe1fbda6 (diff) | |
| download | vyos-walinuxagent-5009a9d0f3606fc08a80ec0d59076d8dc48d2f25.tar.gz vyos-walinuxagent-5009a9d0f3606fc08a80ec0d59076d8dc48d2f25.zip | |
Import patches-unapplied version 2.1.5-0ubuntu1 to ubuntu/yakkety-proposed
Imported using git-ubuntu import.
Changelog parent: 0f7cef5b52162d1ebb31a738bd8fc9febe1fbda6
New changelog entries:
* New upstream release (LP: #1603581)
- d/patches/disable-auto-update.patch:
- The new version introduces auto-updating of the agent to its latest
version via an internal mechanism; disable this
- d/patches/fix_shebangs.patch:
- Dropped in favour of the dh_python3 --shebang option.
- Refreshed d/patches/disable_udev_overrides.patch
Diffstat (limited to 'bin')
| -rw-r--r-- | bin/waagent2.0 | 19 |
1 files changed, 13 insertions, 6 deletions
diff --git a/bin/waagent2.0 b/bin/waagent2.0 index 673a04c..abc4448 100644 --- a/bin/waagent2.0 +++ b/bin/waagent2.0 @@ -228,6 +228,9 @@ class AbstractDistro(object): Returns exit result. """ if self.isSelinuxSystem(): + if not os.path.exists(path): + Error("Path does not exist: {0}".format(path)) + return 1 return Run('chcon ' + cn + ' ' + path) def setHostname(self,name): @@ -2336,7 +2339,10 @@ def ChangeOwner(filepath, user): except: pass if p != None: - os.chown(filepath, p[2], p[3]) + if not os.path.exists(filepath): + Error("Path does not exist: {0}".format(filepath)) + else: + os.chown(filepath, p[2], p[3]) def CreateDir(dirpath, user, mode): """ @@ -4079,7 +4085,7 @@ class ExtensionsConfig(object): try: incarnation=self.Extensions[0].getAttribute("goalStateIncarnation") except: - Error('Error parsing ExtensionsConfig. Unable to send status reports') + Error('Error parsing attribute "goalStateIncarnation". Unable to send status reports') return -1 status='' statuses='' @@ -4117,7 +4123,7 @@ class ExtensionsConfig(object): try: uri=GetNodeTextData(self.Extensions[0].getElementsByTagName("StatusUploadBlob")[0]).replace('&','&') except: - Error('Error parsing ExtensionsConfig. Unable to send status reports') + Error('Error parsing element "StatusUploadBlob". Unable to send status reports') return -1 LogIfVerbose('Status report '+status+' sent to ' + uri) @@ -4607,7 +4613,7 @@ class OvfEnv(object): if len(CDSection) > 0 : self.CustomData=GetNodeTextData(CDSection[0]) if len(self.CustomData)>0: - SetFileContents(LibDir + '/CustomData', bytearray(MyDistro.translateCustomData(self.CustomData))) + SetFileContents(LibDir + '/CustomData', bytearray(MyDistro.translateCustomData(self.CustomData), 'utf-8')) Log('Wrote ' + LibDir + '/CustomData') else : Error('<CustomData> contains no data!') @@ -4912,8 +4918,9 @@ class WALAEventMonitor(WALAEvent): def EventsLoop(self): LastReportHeartBeatTime = datetime.datetime.min try: - while(True): - if (datetime.datetime.now()-LastReportHeartBeatTime) > datetime.timedelta(hours=12): + while True: + if (datetime.datetime.now()-LastReportHeartBeatTime) > \ + datetime.timedelta(minutes=30): LastReportHeartBeatTime = datetime.datetime.now() AddExtensionEvent(op=WALAEventOperation.HeartBeat,name="WALA",isSuccess=True) self.postNumbersInOneLoop=0 |
