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 #18568: Fix metrics-reporting script #2381

Conversation

amousset
Copy link
Member

@amousset
Copy link
Member Author

Currently broken so the risk should be quite self-contained

@@ -139,16 +142,19 @@ def metrics():
pass

# Installation date
cmd="find /opt/rudder/bin/ -type f -exec stat -c \"%Z %n\" {} \; | sort -n | head -n1 | awk '{print $2}' | xargs -r stat -c \"%z\""
cmd="stat -c \"%y\" /var/rudder/cfengine-community/ppkeys/localhost.pub"
Copy link
Member Author

Choose a reason for hiding this comment

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

not perfect but previous commands gave me latest uprade date

@@ -55,7 +58,7 @@ def metrics():
data = { }

# Define the versionning of the file
data['file_version'] = "2"
data['file_version'] = "3"
Copy link
Member Author

Choose a reason for hiding this comment

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

we should maybe do this in 6.2

Copy link
Member

Choose a reason for hiding this comment

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

No, I think it's ok, because the user of that file/API is us - so the burden is on our side.

@amousset
Copy link
Member Author

PR updated with a new commit

@@ -195,7 +204,7 @@ def init_commands():
psql_host = match.group(1)
psql_port = match.group(2)
psql_cmd = "psql -h " + psql_host + " -U " + psql_user
ldap_cmd = "/opt/rudder/bin/ldapsearch -x -z0 -h " + ldap_host + " -p " + ldap_port + " -D " + ldap_user + " -w " + ldap_pwd
ldap_cmd = "ldapsearch -x -z0 -h " + ldap_host + " -p " + ldap_port + " -D " + ldap_user + " -w " + ldap_pwd
Copy link
Member

Choose a reason for hiding this comment

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

python can use the PATH ?

Copy link
Member Author

Choose a reason for hiding this comment

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

yes

@Normation-Quality-Assistant
Copy link
Contributor

This PR is not mergeable to upper versions.
Since it is "Ready for merge" you must merge it by yourself using the following command:
rudder-dev merge https://github.com/Normation/rudder-packages/pull/2381
-- Your faithful QA
Kant merge: "Live your life as though your every act were to become a universal law."
(https://ci.normation.com/jenkins/job/merge-accepted-pr/32527/console)

@amousset
Copy link
Member Author

OK, squash merging this PR

@amousset amousset force-pushed the bug_18568/fix_metrics_reporting_script branch from 437bef2 to 6d46971 Compare November 16, 2020 11:06
@amousset amousset merged commit 6d46971 into Normation:branches/rudder/6.1 Nov 16, 2020
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
5 participants