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

refactor: Updated the oxidized script #8572

Merged
merged 2 commits into from Apr 26, 2018

Conversation

Projects
None yet
4 participants
@laf
Member

laf commented Apr 17, 2018

DO NOT DELETE THIS TEXT

Please note

Please read this information carefully. You can run ./scripts/pre-commit.php to check your code before submitting.

Testers

If you would like to test this pull request then please run: ./scripts/github-apply <pr_id>, i.e ./scripts/github-apply 5926

Username is not always available so make it optional.

No need for librenms version so scrap that off.

Cut down function calls and avoid setting temp $user variable.

@laf laf added the Refactor label Apr 17, 2018

if ($version != "") {
$version = "/".$version;
}
$postdata = ["user" => $username, "msg" => $msg];
$curl = curl_init();

This comment has been minimized.

@murrant

murrant Apr 20, 2018

Member

@laf I noticed we pull in http://requests.ryanmccue.info/ but it is only used for peeringdb.
Thoughts on using this all over instead of curl?

This comment has been minimized.

@laf

laf Apr 21, 2018

Member

Good shout, updated + used Config::get()

@murrant

This comment has been minimized.

Member

murrant commented Apr 20, 2018

Looks good, just a tangential question...

@scrutinizer-notifier

This comment has been minimized.

scrutinizer-notifier commented Apr 21, 2018

The inspection completed: 1 new issues

@f0o

f0o approved these changes Apr 25, 2018

$postdata = ["user" => $username, "msg" => $msg];
$oxidized_url = Config::get('oxidized.url');
if (!empty($oxidized_url)) {
Requests::put("$oxidized_url/node/next/$hostname", [], json_encode($postdata), ['proxy' => get_proxy()]);

This comment has been minimized.

@murrant

murrant Apr 26, 2018

Member

You sure the json_encode() is correct here?

This comment has been minimized.

@murrant

murrant Apr 26, 2018

Member

Nevermind.

@murrant murrant merged commit d799600 into librenms:master Apr 26, 2018

2 checks passed

continuous-integration/travis-ci/pr The Travis CI build passed
Details
license/cla Contributor License Agreement is signed.
Details

@laf laf deleted the laf:refactor/oxidized-script branch Apr 26, 2018

TheMysteriousX added a commit to TheMysteriousX/librenms that referenced this pull request May 20, 2018

refactor: Updated the oxidized script (librenms#8572)
* refactor: Updated the oxidized script

* Updated to use rmccue::Requests + Config::get()

@lock lock bot locked as resolved and limited conversation to collaborators Jun 25, 2018

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.