output of cc_ssh_authkey_fingerprints goes only to /dev/console

Bug #1039303 reported by Scott Moser
8
This bug affects 1 person
Affects Status Importance Assigned to Milestone
cloud-init
Expired
Low
Unassigned

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.

Revision history for this message
Scott Moser (smoser) wrote :

I'm going to go ahead and commit the simple fix mentioned above, and then see if we can't fix this better later.

summary: - output of cc_ssh_authkey_fingerprints is duplicated
+ output of cc_ssh_authkey_fingerprints goes only to /dev/console
Scott Moser (smoser)
Changed in cloud-init:
status: New → Confirmed
importance: Undecided → Low
Revision history for this message
James Falcon (falcojr) wrote :
Changed in cloud-init:
status: Confirmed → Expired
To post a comment you must log in.
This report contains Public information  
Everyone can see this information.

Other bug subscribers

Remote bug watches

Bug watches keep track of this bug in other bug trackers.