summaryrefslogtreecommitdiff
path: root/azurelinuxagent/distro/coreos
diff options
context:
space:
mode:
authorBen Howard <ben.howard@ubuntu.com>2016-02-08 16:33:07 -0700
committerusd-importer <ubuntu-server@lists.ubuntu.com>2016-02-09 00:59:05 +0000
commita00729ff7421b3661e8b1a1e0fa46393379f2e96 (patch)
tree4563b927e3a57446a4a928a72a92d72c9ad4f6e6 /azurelinuxagent/distro/coreos
parent53f54030cae2de3d5fa474a61fe51f16c7a07c79 (diff)
downloadvyos-walinuxagent-a00729ff7421b3661e8b1a1e0fa46393379f2e96.tar.gz
vyos-walinuxagent-a00729ff7421b3661e8b1a1e0fa46393379f2e96.zip
Import patches-unapplied version 2.1.3-0ubuntu1 to ubuntu/xenial-proposed
Imported using git-ubuntu import. Changelog parent: 53f54030cae2de3d5fa474a61fe51f16c7a07c79 New changelog entries: * New upstream release (LP: #1543359): - Bug fixes for extension handling - Feature enablement for AzureStack.
Diffstat (limited to 'azurelinuxagent/distro/coreos')
-rw-r--r--azurelinuxagent/distro/coreos/deprovision.py3
-rw-r--r--azurelinuxagent/distro/coreos/distro.py (renamed from azurelinuxagent/distro/coreos/handlerFactory.py)12
-rw-r--r--azurelinuxagent/distro/coreos/loader.py28
-rw-r--r--azurelinuxagent/distro/coreos/osutil.py5
4 files changed, 11 insertions, 37 deletions
diff --git a/azurelinuxagent/distro/coreos/deprovision.py b/azurelinuxagent/distro/coreos/deprovision.py
index 99d3a40..9642579 100644
--- a/azurelinuxagent/distro/coreos/deprovision.py
+++ b/azurelinuxagent/distro/coreos/deprovision.py
@@ -21,6 +21,9 @@ import azurelinuxagent.utils.fileutil as fileutil
from azurelinuxagent.distro.default.deprovision import DeprovisionHandler, DeprovisionAction
class CoreOSDeprovisionHandler(DeprovisionHandler):
+ def __init__(self, distro):
+ self.distro = distro
+
def setup(self, deluser):
warnings, actions = super(CoreOSDeprovisionHandler, self).setup(deluser)
warnings.append("WARNING! /etc/machine-id will be removed.")
diff --git a/azurelinuxagent/distro/coreos/handlerFactory.py b/azurelinuxagent/distro/coreos/distro.py
index 58f476c..04c7bff 100644
--- a/azurelinuxagent/distro/coreos/handlerFactory.py
+++ b/azurelinuxagent/distro/coreos/distro.py
@@ -17,11 +17,13 @@
# Requires Python 2.4+ and Openssl 1.0+
#
-from .deprovision import CoreOSDeprovisionHandler
-from azurelinuxagent.distro.default.handlerFactory import DefaultHandlerFactory
+from azurelinuxagent.distro.default.distro import DefaultDistro
+from azurelinuxagent.distro.coreos.osutil import CoreOSUtil
+from azurelinuxagent.distro.coreos.deprovision import CoreOSDeprovisionHandler
-class CoreOSHandlerFactory(DefaultHandlerFactory):
+class CoreOSDistro(DefaultDistro):
def __init__(self):
- super(CoreOSHandlerFactory, self).__init__()
- self.deprovision_handler = CoreOSDeprovisionHandler()
+ super(CoreOSDistro, self).__init__()
+ self.osutil = CoreOSUtil()
+ self.deprovision_handler = CoreOSDeprovisionHandler(self)
diff --git a/azurelinuxagent/distro/coreos/loader.py b/azurelinuxagent/distro/coreos/loader.py
deleted file mode 100644
index 802f276..0000000
--- a/azurelinuxagent/distro/coreos/loader.py
+++ /dev/null
@@ -1,28 +0,0 @@
-# Microsoft Azure Linux Agent
-#
-# Copyright 2014 Microsoft Corporation
-#
-# Licensed under the Apache License, Version 2.0 (the "License");
-# you may not use this file except in compliance with the License.
-# You may obtain a copy of the License at
-#
-# http://www.apache.org/licenses/LICENSE-2.0
-#
-# Unless required by applicable law or agreed to in writing, software
-# distributed under the License is distributed on an "AS IS" BASIS,
-# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
-# See the License for the specific language governing permissions and
-# limitations under the License.
-#
-# Requires Python 2.4+ and Openssl 1.0+
-#
-
-
-def get_osutil():
- from azurelinuxagent.distro.coreos.osutil import CoreOSUtil
- return CoreOSUtil()
-
-def get_handlers():
- from azurelinuxagent.distro.coreos.handlerFactory import CoreOSHandlerFactory
- return CoreOSHandlerFactory()
-
diff --git a/azurelinuxagent/distro/coreos/osutil.py b/azurelinuxagent/distro/coreos/osutil.py
index c244311..ffc83e3 100644
--- a/azurelinuxagent/distro/coreos/osutil.py
+++ b/azurelinuxagent/distro/coreos/osutil.py
@@ -35,9 +35,9 @@ from azurelinuxagent.distro.default.osutil import DefaultOSUtil
class CoreOSUtil(DefaultOSUtil):
def __init__(self):
super(CoreOSUtil, self).__init__()
+ self.agent_conf_file_path = '/usr/share/oem/waagent.conf'
self.waagent_path='/usr/share/oem/bin/waagent'
self.python_path='/usr/share/oem/python/bin'
- self.conf_file_path = '/usr/share/oem/waagent.conf'
if 'PATH' in os.environ:
path = "{0}:{1}".format(os.environ['PATH'], self.python_path)
else:
@@ -85,9 +85,6 @@ class CoreOSUtil(DefaultOSUtil):
ret= shellutil.run_get_output("pidof systemd-networkd")
return ret[1] if ret[0] == 0 else None
- def decode_customdata(self, data):
- return base64.b64decode(data)
-
def set_ssh_client_alive_interval(self):
#In CoreOS, /etc/sshd_config is mount readonly. Skip the setting
pass