First argument to part_handler methods should not be None

Bug #1669749 reported by Fritz Elfert
6
This bug affects 1 person
Affects Status Importance Assigned to Milestone
cloudbase-init
Incomplete
Undecided
Unassigned

Bug Description

In order to write a proper part handler, the first argument should be an object which lets the plugin have access to the config and at least to some logging and ideally other class instances.

Background:
I was annoyed by the fact that WINRM certificates and ordinary userData are mutually exclusive. Therefore I started writing a part_handler for 'application/x-x509-user-cert' when i realized that I cannot even use the existing loggging functionality let alone the existing WINRM related classes.

Revision history for this message
Adrian Vladu (avladu) wrote :

Hello,

You can import at any time the logging libraries and (os)utils ones.
If you implement this patch, I will be glad to help you send it on the review queue.

Thank you,
Adrian Vladu

Adrian Vladu (avladu)
Changed in cloudbase-init:
status: New → Incomplete
Revision history for this message
Fritz Elfert (felfert) wrote :

It is not so much about importing. It is about shared data (in memory), cached in the other plugins. Also, importing the logging module does not help, because COM1: cannot be shared. If the "main" cloudbase-init already uses COM1. then I cannot open COM1: again from within my plugin. The correct way ist to share the *Instance* of the logger.

Revision history for this message
Fritz Elfert (felfert) wrote :

BTW, look at cloud-init. They do it correctly (apart from the logging problem which they do not have).

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.