summaryrefslogtreecommitdiff
path: root/setup.py
diff options
context:
space:
mode:
authorDaniel Watkins <daniel.watkins@canonical.com>2016-09-13 16:11:47 +0100
committerusd-importer <ubuntu-server@lists.ubuntu.com>2016-09-14 10:39:12 +0000
commit5009a9d0f3606fc08a80ec0d59076d8dc48d2f25 (patch)
treead67eef74c5208178950db6ee28195e2137fa713 /setup.py
parent0f7cef5b52162d1ebb31a738bd8fc9febe1fbda6 (diff)
downloadvyos-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 'setup.py')
-rwxr-xr-xsetup.py53
1 files changed, 36 insertions, 17 deletions
diff --git a/setup.py b/setup.py
index c799787..da91778 100755
--- a/setup.py
+++ b/setup.py
@@ -18,11 +18,11 @@
#
import os
-from azurelinuxagent.metadata import AGENT_NAME, AGENT_VERSION, \
+from azurelinuxagent.common.version import AGENT_NAME, AGENT_VERSION, \
AGENT_DESCRIPTION, \
DISTRO_NAME, DISTRO_VERSION, DISTRO_FULL_NAME
-from azurelinuxagent.agent import Agent
+from azurelinuxagent.common.osutil import get_osutil
import setuptools
from setuptools import find_packages
from setuptools.command.install import install as _install
@@ -51,6 +51,13 @@ def set_systemd_files(data_files, dest="/lib/systemd/system",
src=["init/waagent.service"]):
data_files.append((dest, src))
+def set_rc_files(data_files, dest="/etc/rc.d/", src=["init/freebsd/waagent"]):
+ data_files.append((dest, src))
+
+def set_udev_files(data_files, dest="/etc/udev/rules.d/", src=["config/66-azure-storage.rules", "config/99-azure-product-uuid.rules"]):
+ data_files.append((dest, src))
+
+
def get_data_files(name, version, fullname):
"""
Determine data_files according to distro name, version and init system type
@@ -61,6 +68,7 @@ def get_data_files(name, version, fullname):
set_bin_files(data_files)
set_conf_files(data_files)
set_logrotate_files(data_files)
+ set_udev_files(data_files)
if version.startswith("6"):
set_sysv_files(data_files)
else:
@@ -75,12 +83,14 @@ def get_data_files(name, version, fullname):
set_conf_files(data_files, dest="/usr/share/oem",
src=["config/coreos/waagent.conf"])
set_logrotate_files(data_files)
+ set_udev_files(data_files)
set_files(data_files, dest="/usr/share/oem",
- src="init/coreos/cloud-config.yml")
+ src=["init/coreos/cloud-config.yml"])
elif name == 'ubuntu':
set_bin_files(data_files)
set_conf_files(data_files, src=["config/ubuntu/waagent.conf"])
set_logrotate_files(data_files)
+ set_udev_files(data_files, src=["config/99-azure-product-uuid.rules"])
if version.startswith("12") or version.startswith("14"):
#Ubuntu12.04/14.04 - uses upstart
set_files(data_files, dest="/etc/init",
@@ -98,6 +108,7 @@ def get_data_files(name, version, fullname):
set_bin_files(data_files)
set_conf_files(data_files, src=["config/suse/waagent.conf"])
set_logrotate_files(data_files)
+ set_udev_files(data_files)
if fullname == 'SUSE Linux Enterprise Server' and \
version.startswith('11') or \
fullname == 'openSUSE' and version.startswith('13.1'):
@@ -106,11 +117,16 @@ def get_data_files(name, version, fullname):
else:
#sles 12+ and openSUSE 13.2+ use systemd
set_systemd_files(data_files, dest='/usr/lib/systemd/system')
+ elif name == 'freebsd':
+ set_bin_files(data_files, dest="/usr/local/sbin")
+ set_conf_files(data_files, src=["config/freebsd/waagent.conf"])
+ set_rc_files(data_files)
else:
#Use default setting
set_bin_files(data_files)
set_conf_files(data_files)
set_logrotate_files(data_files)
+ set_udev_files(data_files)
set_sysv_files(data_files)
return data_files
@@ -150,17 +166,20 @@ class install(_install):
def run(self):
_install.run(self)
if self.register_service:
- Agent(False).register_service()
-
-setuptools.setup(name=AGENT_NAME,
- version=AGENT_VERSION,
- long_description=AGENT_DESCRIPTION,
- author= 'Yue Zhang, Stephen Zarkos, Eric Gable',
- author_email = 'walinuxagent@microsoft.com',
- platforms = 'Linux',
- url='https://github.com/Azure/WALinuxAgent',
- license = 'Apache License Version 2.0',
- packages=find_packages(exclude=["tests"]),
- cmdclass = {
- 'install': install
- })
+ get_osutil().register_agent_service()
+
+setuptools.setup(
+ name=AGENT_NAME,
+ version=AGENT_VERSION,
+ long_description=AGENT_DESCRIPTION,
+ author= 'Yue Zhang, Stephen Zarkos, Eric Gable',
+ author_email = 'walinuxagent@microsoft.com',
+ platforms = 'Linux',
+ url='https://github.com/Azure/WALinuxAgent',
+ license = 'Apache License Version 2.0',
+ packages=find_packages(exclude=["tests"]),
+ py_modules=["__main__"],
+ cmdclass = {
+ 'install': install
+ }
+)