summaryrefslogtreecommitdiff
path: root/azurelinuxagent/metadata.py
diff options
context:
space:
mode:
authorBen Howard <ben.howard@ubuntu.com>2015-12-07 16:48:51 -0700
committerusd-importer <ubuntu-server@lists.ubuntu.com>2015-12-08 16:10:11 +0000
commit542c7a834728ad35d7f5f98cacdf78d86721656f (patch)
tree6850cbc7ce3dec800c1b50f23da6b76077198159 /azurelinuxagent/metadata.py
parentf6e3f158c2fb9021b37654ea20839ec7a4308d52 (diff)
parentf4e6aca60e419eafbdf11bdd631d35cf785735ae (diff)
downloadvyos-walinuxagent-542c7a834728ad35d7f5f98cacdf78d86721656f.tar.gz
vyos-walinuxagent-542c7a834728ad35d7f5f98cacdf78d86721656f.zip
Import patches-applied version 2.1.2-0ubuntu1 to applied/ubuntu/xenial-proposed
Imported using git-ubuntu import. Changelog parent: f6e3f158c2fb9021b37654ea20839ec7a4308d52 Unapplied parent: f4e6aca60e419eafbdf11bdd631d35cf785735ae New changelog entries: * New upstream release (LP: #1523715): - Bug fixes for Ubuntu 15.10 on Azure - Enablement for Azure Stack - Dropped patch for systemd job as upstream now includes it.
Diffstat (limited to 'azurelinuxagent/metadata.py')
-rw-r--r--azurelinuxagent/metadata.py27
1 files changed, 8 insertions, 19 deletions
diff --git a/azurelinuxagent/metadata.py b/azurelinuxagent/metadata.py
index 83d4676..5cf4902 100644
--- a/azurelinuxagent/metadata.py
+++ b/azurelinuxagent/metadata.py
@@ -1,4 +1,4 @@
-# Windows Azure Linux Agent
+# Microsoft Azure Linux Agent
#
# Copyright 2014 Microsoft Corporation
#
@@ -21,6 +21,7 @@ import os
import re
import platform
import sys
+import azurelinuxagent.utils.fileutil as fileutil
from azurelinuxagent.future import text
def get_distro():
@@ -46,7 +47,7 @@ def get_distro():
AGENT_NAME = "WALinuxAgent"
AGENT_LONG_NAME = "Azure Linux Agent"
-AGENT_VERSION = '2.1.1'
+AGENT_VERSION = '2.1.2'
AGENT_LONG_VERSION = "{0}-{1}".format(AGENT_NAME, AGENT_VERSION)
AGENT_DESCRIPTION = """\
The Azure Linux Agent supports the provisioning and running of Linux
@@ -70,24 +71,12 @@ PY_VERSION_MICRO = sys.version_info[2]
Add this walk arround for detecting Snappy Ubuntu Core temporarily, until ubuntu
fixed this bug: https://bugs.launchpad.net/snappy/+bug/1481086
"""
-def which(program):
- # Return path of program for execution if found in path
- def is_exe(fpath):
- return os.path.isfile(fpath) and os.access(fpath, os.X_OK)
- _fpath, _ = os.path.split(program)
- if _fpath:
- if is_exe(program):
- return program
- else:
- for path in os.environ.get("PATH", "").split(os.pathsep):
- path = path.strip('"')
- exe_file = os.path.join(path, program)
- if is_exe(exe_file):
- return exe_file
- return None
-
def is_snappy():
- return which("snappy")
+ if os.path.exists("/etc/motd"):
+ motd = fileutil.read_file("/etc/motd")
+ if "snappy" in motd:
+ return True
+ return False
if is_snappy():
DISTRO_FULL_NAME = "Snappy Ubuntu Core"