summaryrefslogtreecommitdiff
path: root/azurelinuxagent/agent.py
diff options
context:
space:
mode:
authorƁukasz 'sil2100' Zemczak <lukasz.zemczak@ubuntu.com>2018-02-05 17:25:14 +0100
committerusd-importer <ubuntu-server@lists.ubuntu.com>2018-02-05 19:15:55 +0000
commit6c9cd7e1ac55aae259d8e2f06569375e27a12f20 (patch)
tree335726f611f1ed30aef7d82ff0e2bae0a91ff44b /azurelinuxagent/agent.py
parent110d301b04a64d680fc7d102424e303a8e3ca1a6 (diff)
parentd5298bbf0f5696fc948877304e86f43d477d6b71 (diff)
downloadvyos-walinuxagent-6c9cd7e1ac55aae259d8e2f06569375e27a12f20.tar.gz
vyos-walinuxagent-6c9cd7e1ac55aae259d8e2f06569375e27a12f20.zip
Import patches-applied version 2.2.21-0ubuntu1 to applied/ubuntu/bionic-proposed
Imported using git-ubuntu import. Changelog parent: 110d301b04a64d680fc7d102424e303a8e3ca1a6 Unapplied parent: d5298bbf0f5696fc948877304e86f43d477d6b71 New changelog entries: * New upstream release (LP: #1746628). * debian/patches/disable_import_test.patch: refreshed patch.
Diffstat (limited to 'azurelinuxagent/agent.py')
-rw-r--r--azurelinuxagent/agent.py18
1 files changed, 11 insertions, 7 deletions
diff --git a/azurelinuxagent/agent.py b/azurelinuxagent/agent.py
index e99f7be..4ab7aa0 100644
--- a/azurelinuxagent/agent.py
+++ b/azurelinuxagent/agent.py
@@ -63,6 +63,9 @@ class Agent(object):
path="/var/log/waagent.log")
logger.add_logger_appender(logger.AppenderType.CONSOLE, level,
path="/dev/console")
+ logger.add_logger_appender(logger.AppenderType.TELEMETRY,
+ logger.LogLevel.WARNING,
+ path=event.add_log_event)
ext_log_dir = conf.get_ext_log_dir()
try:
@@ -144,7 +147,7 @@ def main(args=[]):
if command == "version":
version()
elif command == "help":
- usage()
+ print(usage())
elif command == "start":
start(conf_file_path=conf_file_path)
else:
@@ -228,15 +231,16 @@ def version():
def usage():
"""
- Show agent usage
+ Return agent usage message
"""
- print("")
- print((("usage: {0} [-verbose] [-force] [-help] "
+ s = "\n"
+ s += ("usage: {0} [-verbose] [-force] [-help] "
"-configuration-path:<path to configuration file>"
"-deprovision[+user]|-register-service|-version|-daemon|-start|"
- "-run-exthandlers]"
- "").format(sys.argv[0])))
- print("")
+ "-run-exthandlers|-show-configuration]"
+ "").format(sys.argv[0])
+ s += "\n"
+ return s
def start(conf_file_path=None):
"""