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

Fixing that the suffix can be empty as well (needed for mysql-connector > 8) #337

Merged
merged 1 commit into from
Feb 1, 2021

Conversation

diLLec
Copy link
Contributor

@diLLec diLLec commented Jan 19, 2021

Pull Request (PR) description

The change is needed to specificy and use a mysql-connector version > 8. The problem with those connectors is, that there is no "-bin" suffix in the jarfile and therefore the suffix needs to be empty. As the current String will require the string to be at least 1 character long, a version 8 connector can not be configured.

class {'jira':
...
    mysql_connector_manage       => true,
    mysql_connector_version      => '8.0.23',
    mysql_connector_install      => '/opt/MySQL-connector',
    mysql_connector_url          => 'https://dev.mysql.com/get/Downloads/Connector-J',
    mysql_connector_jar_suffix   => '', # no '-bin'!
...

results in
Could not retrieve catalog from remote server: Error 500 on SERVER: Server Error: Evaluation Error: Error while evaluating a Resource Statement, Class[Jira]: parameter 'mysql_connector_jar_suffix' expects a String[1, default]

This Pull Request (PR) fixes the following issues

Enables the useage of mysql-connector version > 8

@@ -71,7 +71,7 @@
$mysql_connector_format = 'tar.gz',
Stdlib::Absolutepath $mysql_connector_install = '/opt/MySQL-connector',
Stdlib::HTTPUrl $mysql_connector_url = 'https://dev.mysql.com/get/Downloads/Connector-J',
String[1] $mysql_connector_jar_suffix = '-bin',
String $mysql_connector_jar_suffix = '-bin',
Copy link
Member

Choose a reason for hiding this comment

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

can you please add a test for this that ensures it works with an empty string? Otherwise people might readd String[1] in the future.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Resolved and tests added - please see comment below

@diLLec
Copy link
Contributor Author

diLLec commented Feb 1, 2021

While working on the patch I've seen, that there already is version handlig code in the project (install.pp for example). Following that example I've put deleted the "suffix" variable and added logic that will change the filename scheme of the mysql connector jar based on the version.

@bastelfreak please review.

@bastelfreak bastelfreak added bug Something isn't working and removed needs-tests labels Feb 1, 2021
@bastelfreak
Copy link
Member

thanks for the update!

@bastelfreak bastelfreak merged commit 540c609 into voxpupuli:master Feb 1, 2021
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants