Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Support for virtual execution module pkg on AIX #48924

Merged
merged 9 commits into from
Aug 8, 2018

Conversation

dmurphy18
Copy link
Contributor

@dmurphy18 dmurphy18 commented Aug 3, 2018

What does this PR do?

Added support for virtual execution module pkg on AIX,
provides support for pkg.install, pkg.remove, pkg.list_pkgs, pkg.version

Also adds support for pkg.is_installed

Adds ability to install/remove IBM AIX filesets and/or rpm packages for the AIX platform

What issues does this PR fix or reference?

https://github.com/saltstack/zh/issues/1408

Previous Behavior

There was no support for execution module pkg on AIX

New Behavior

pkg.install, pkg.remove, pkg.list_pkgs, pkg.version, pkg.is_installed are now functional on AIX

Tests written?

No - Tests coming lates

Commits signed with GPG?

No

Please review Salt's Contributing Guide for best practices.

See GitHub's page on GPG signing for more information about signing commits with GPG.

@ghost ghost self-requested a review August 3, 2018 16:38
@rallytime rallytime added the ZRELEASED - Fluorine reitred label label Aug 3, 2018
Copy link
Contributor

@terminalmage terminalmage left a comment

Choose a reason for hiding this comment

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

This is missing functions like latest_version. Please refer to our package provider writing documentation here: https://docs.saltstack.com/en/latest/topics/development/package_providers.html#package-functions

@dmurphy18
Copy link
Contributor Author

dmurphy18 commented Aug 3, 2018

@terminalmage I know, talked with Kent Besaw about the additional functionality, since he talks with the customer weekly (that requested this support) and agreed to limit to the functionality requested rather than adding extra's not originally requested. So pulled that out: but can add it and others back in to provide barest minimum support to meet Fluorine commitments. Can add latest_available and upgrade_available (not too applicable in AIX since no repositories as in the sense of Linux or even Solaris, and the latest is that already committed to the database AIX keeps - ODM). Can add the functions and have them return what is already there.

Decision was to add the additional functionality after Fluorine shipped.

@terminalmage
Copy link
Contributor

I don't find that to be an acceptable solution, since pkg states expect at least some of the missing functions to exist and will throw a KeyError if you run them and they're not.

@dmurphy18
Copy link
Contributor Author

@terminalmage I was going to check the states pkg to see what was affected when writing the unit tests. I shall have another talk with Kent and raise the issues again with him, to push for the other functionality.

@dmurphy18
Copy link
Contributor Author

@terminalmage talked with Kent and adding latest_version and upgrade_available. Others shall be added in another PR, to ensure this meets deadlines

@dmurphy18
Copy link
Contributor Author

@terminalmage Added support for pkg.latest_version, pkg.upgrade_available similar to Solaris 10 which also does not support repositories.

@rallytime
Copy link
Contributor

@dmurphy18 This has some lint errors. Can you fix those, please?

https://jenkinsci.saltstack.com/job/pr-lint/job/PR-48924/4/warnings52Result/

salt '*' pkg.latest_version <package name>
salt '*' pkg.latest_version <package1> <package2> <package3> ...

NOTE: As package repositories are not presently supported for AIX
Copy link
Contributor

Choose a reason for hiding this comment

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

"package repositories" is redundant as it results in the word "package" appearing twice in the same clause. Also, the 2nd appearance should be "packages", not "package". Thus, this should be:

    NOTE: As repositories are not presently supported for AIX installp/RPM
    packages, this function will always return an empty string for a given
    package.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

@terminalmage I hate getting nailed by cut and paste, :(, will fix.

@dmurphy18
Copy link
Contributor Author

@rallytime Those pylint errors are fixed.

@dmurphy18
Copy link
Contributor Author

@rallytime Can Mike be pulled as a reviewer since he is PTO and a continent and an ocean away ?

if __grains__['os_family'] == 'AIX':
return __virtualname__
return (False,
'The aixpkg execution module failed to load.')
Copy link
Contributor

Choose a reason for hiding this comment

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

I don't think this is a good error message. failed suggests that it should have loaded and did not. Perhaps something like Did not load AIX module on non-AIX OS?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Updated message, was following error messages currently used for other pkg execution modules.

return __salt__['cmd.retcode'](cmd) == 0


def install(name=None, refresh=False, pkgs=None, version=None, test=False, **kwargs):
Copy link
Contributor

Choose a reason for hiding this comment

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

version and test doesn't appear to be documented below.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

@cachedout Will update to include refresh, version and test.

@rallytime rallytime changed the base branch from develop to fluorine August 6, 2018 20:27
@rallytime
Copy link
Contributor

@dmurphy18 I have changed the base branch of this PR from develop to fluorine for inclusion in the Fluorine feature release.

@rallytime rallytime merged commit 0403a6d into saltstack:fluorine Aug 8, 2018
@dmurphy18 dmurphy18 deleted the aix_pkg branch August 4, 2020 17:47
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

4 participants