yahoo-eng-team team mailing list archive
-
yahoo-eng-team team
-
Mailing list archive
-
Message #91887
[Bug 1039303] Re: output of cc_ssh_authkey_fingerprints goes only to /dev/console
Tracked in Github Issues as https://github.com/canonical/cloud-
init/issues/2284
** Bug watch added: github.com/canonical/cloud-init/issues #2284
https://github.com/canonical/cloud-init/issues/2284
** Changed in: cloud-init
Status: Confirmed => Expired
--
You received this bug notification because you are a member of Yahoo!
Engineering Team, which is subscribed to cloud-init.
https://bugs.launchpad.net/bugs/1039303
Title:
output of cc_ssh_authkey_fingerprints goes only to /dev/console
Status in cloud-init:
Expired
Bug description:
I have an instance launched with cloud-config like:
output: {all: '| tee -a /var/log/cloud-init-output.log'}
The output of ssh_authkey_fingerprints gets to the console twice.
This is because it calls:
for line in lines:
util.multi_log(text="%s%s\n" % (prefix, line))
The other occurance of a config module that writes to the console is
keys_to_console, which does:
util.multi_log("%s\n" % (stdout.strip()),
stderr=False, console=True)
So, clearly a simple solution is just to turn 'stderr=False' (default for
multi_log is True). However, that means that if the user runs this module
like:
cloud-init --force single -n ssh_authkey_fingerprints --frequency always
Then they'll get no output.
This just represents a more general problem, of how do we have
something explicitly write to the console, but not doubly write there.
To manage notifications about this bug go to:
https://bugs.launchpad.net/cloud-init/+bug/1039303/+subscriptions