Skip to content
This repository has been archived by the owner on Aug 23, 2021. It is now read-only.

Fixed subp import #54

Merged
merged 1 commit into from
Sep 22, 2020
Merged

Fixed subp import #54

merged 1 commit into from
Sep 22, 2020

Conversation

sshedi
Copy link
Contributor

@sshedi sshedi commented Sep 12, 2020

Made minor code improvements in getting subp module

Signed-off-by: Shreenidhi Shedi [email protected]

@jfroche
Copy link

jfroche commented Sep 16, 2020

You are removing the test if hasattr(subp, 'subp'): which verifies if subp package has a subp function.
We are running Ubuntu 18.04 with cloud-init 20.2-45 and we have this:

>>> from cloudinit import subp
>>> subp.subp
Traceback (most recent call last):
  File "<stdin>", line 1, in <module>
AttributeError: module 'cloudinit.subp' has no attribute 'subp'
>>> from cloudinit import util
>>> util.subp
<function subp at 0x7fae4157a730>

So we have a subp package but no subp function, so we should be using cloudinit.util

@sshedi
Copy link
Contributor Author

sshedi commented Sep 17, 2020

@jfroche thanks, I missed it. Will send an update soon. It's weird what's been done in cloud-init, not moving a module fully in one shot. Simple added to further complications.

@yvespp
Copy link
Contributor

yvespp commented Sep 18, 2020

Maybe this would be cleaner/easier to read:

try:
    from cloudinit.subp import subp, ProcessExecutionError
except ImportError:
    from cloudinit.util import subp, ProcessExecutionError

and call the methods directly (remove all subp_module references)

@skyscooby
Copy link

Could we prioritise merging one of these fixes please? master is broken on latest ubuntu 18.04 cloud-init version at the moment.

@skyscooby
Copy link

skyscooby commented Sep 19, 2020

It would really help the users of this module to make #2 happen.. remember everyone's OS moves forward as they yum/apt update their code.. this module just sits in the python directory unmaintained and gets stale.. either this project needs to start building deb/rpm and host a repository so fixes can be released... or we need to get this code into the cloud-init project proper so they can deal with these module changes directly before releasing.

Anyone relying on this module at the moment who updates their cloud-init package is in for serious pain on their next reboot.

@akutz
Copy link
Contributor

akutz commented Sep 19, 2020

We are trying. The problem is fixing it so that it works across all the various distros (see my earlier note about setting up automated testing pipelines).

I try very much to make this DS backwards compatible so that it will work with all versions of CI on all distros. It is just challenging to cover everything.

I merged two PRs already, but each time new issues were identified issues on additional other distro/cloud-init combinations.

So this time I’m making sure we have are not merging a fix that just breaks something else.

@sshedi
Copy link
Contributor Author

sshedi commented Sep 20, 2020

Maybe this would be cleaner/easier to read:

try:
    from cloudinit.subp import subp, ProcessExecutionError
except ImportError:
    from cloudinit.util import subp, ProcessExecutionError

and call the methods directly (remove all subp_module references)

👍 will update my PR, thanks for the input

@sshedi
Copy link
Contributor Author

sshedi commented Sep 21, 2020

@yvespp @akutz @jfroche Please give it a try, let's finish this one.

DataSourceVMwareGuestInfo.py Outdated Show resolved Hide resolved
Signed-off-by: Shreenidhi Shedi <[email protected]>
Copy link
Contributor

@yvespp yvespp left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Looks got to me now, tested it with Ubuntu 20.04

@LinAnt
Copy link

LinAnt commented Sep 22, 2020

Can confirm this works with Ubuntu 20.04 on vSphere 6.7u3

@angelbarrera92
Copy link

One more here to confirm it works with Ubuntu 18.04. Is there any plan to release it?

@nickvth
Copy link

nickvth commented Sep 22, 2020

@akutz and @yvespp can you review this change and merge if possible?
We are waiting for this fix.

@yvespp
Copy link
Contributor

yvespp commented Sep 22, 2020

@akutz and @yvespp can you review this change and merge if possible?
We are waiting for this fix.

I don't have merge permission.

@akutz akutz merged commit 2f20df6 into vmware-archive:master Sep 22, 2020
@akutz
Copy link
Contributor

akutz commented Sep 22, 2020

@akutz and @yvespp can you review this change and merge if possible?
We are waiting for this fix.

I don't have merge permission.

I was waiting to ensure this was properly tested this time. Merged.

@nickvth
Copy link

nickvth commented Sep 22, 2020

@akutz and @yvespp can you review this change and merge if possible?
We are waiting for this fix.

I don't have merge permission.

I was waiting to ensure this was properly tested this time. Merged.

Thanks @akutz @yvespp @sshedi

@sshedi
Copy link
Contributor Author

sshedi commented Sep 22, 2020

Thanks all for getting involved in this and all the valuable suggestions. Liked it. It was a good learning experience.

@sshedi sshedi deleted the subp-module-fix branch September 22, 2020 18:33
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

8 participants