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

Fixes #20100: Rudder package optional args are not clear enough #3922

Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 2 additions & 2 deletions relay/sources/rudder-pkg/lib/rudder-pkg/rudderPkg.py
Original file line number Diff line number Diff line change
Expand Up @@ -264,10 +264,10 @@ def rudder_postupgrade():
utils.run_script('postinst', script_dir, True)


def check_compatibility(exact_version):
def check_compatibility(strict):
for p in utils.DB['plugins']:
metadata = utils.DB['plugins'][p]
if not utils.check_plugin_compatibility(metadata, exact_version):
if not utils.check_plugin_compatibility(metadata, strict):
logger.warning('Plugin ' + p + ' is not compatible with rudder anymore, disabling it.')
if 'jar-files' in metadata:
for j in metadata['jar-files']:
Expand Down
16 changes: 9 additions & 7 deletions relay/sources/rudder-pkg/rudder-pkg
Original file line number Diff line number Diff line change
Expand Up @@ -5,17 +5,17 @@ Rudder package manager

Usage:
rudder package [--debug] install-file <package.rpkg>...
rudder package [--debug] install <package> [--exact-version][--nightly] [--quiet]
rudder package [--debug] install <package> [--exact-version=<version>][--nightly] [--quiet]
rudder package [--debug] upgrade-all [--nightly] [--quiet]
rudder package [--debug] show <package> [--exact-version] [--nightly]
Copy link
Member

Choose a reason for hiding this comment

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

exact_version is a flag everywhere

Copy link
Member

Choose a reason for hiding this comment

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

it should be --strict

rudder package [--debug] show <package> [--exact-version=<version>] [--nightly]
rudder package [--debug] remove <package>...
rudder package [--debug] search <package>...
rudder package [--debug] list [--all]
rudder package [--debug] update [--quiet]
rudder package [--debug] licenses [--quiet]
rudder package [--debug] check-connection
rudder package [--debug] rudder-postupgrade
rudder package [--debug] check-compatibility [--exact-version]
rudder package [--debug] check-compatibility [--strict]
rudder package [--debug] plugin save-status
rudder package [--debug] plugin restore-status
rudder package [--debug] plugin enable <plugin>...
Expand All @@ -28,6 +28,8 @@ Options:
--version <version> Provide specific version
--nightly Force the command to execute on the nightlies instead of the released plugins
--all List all plugin name available
--strict Verify the compatibility between plugins and the current Rudder version exactly.
Otherwise, the patch version is ignored.
--quiet Deprecated, force the log level to info

Commands:
Expand Down Expand Up @@ -149,10 +151,10 @@ if __name__ == '__main__':
elif args['rudder-postupgrade']:
rudderPkg.rudder_postupgrade()
elif args['check-compatibility']:
exact_version = False
if args['--exact-version']:
exact_version = True
rudderPkg.check_compatibility(exact_version)
strict = False
if args['--strict']:
strict = True
rudderPkg.check_compatibility(strict)
elif args['plugin']:
if args['save-status']:
rudderPkg.plugin_save_status()
Expand Down