Skip to content
This repository has been archived by the owner on Jun 15, 2022. It is now read-only.

Commit

Permalink
Refactor get_host_api_key function to use CamelCase
Browse files Browse the repository at this point in the history
  • Loading branch information
thellimist committed Jun 22, 2017
1 parent 001105e commit 5bad444
Show file tree
Hide file tree
Showing 3 changed files with 8 additions and 8 deletions.
6 changes: 3 additions & 3 deletions APIKey
Expand Up @@ -14,11 +14,11 @@ my ( $uid, $function, $data ) = split( / /, $stdin, 3 );

my $logger = Cpanel::Logger->new();

if ( $function eq 'get_host_api_key' ) {
my $host_api_key = Cpanel::LoadFile::loadfile($HOST_API_KEY_FILE) or do {
if ( $function eq 'getHostApiKey' ) {
my $hostApiKey = Cpanel::LoadFile::loadfile($HOST_API_KEY_FILE) or do {
$logger->info("Failed to load Host API key: $!");
};
print $host_api_key;
print $hostApiKey;
exit(0);
}
else {
Expand Down
6 changes: 3 additions & 3 deletions CloudFlare.pm
Expand Up @@ -28,15 +28,15 @@ my $logger = Cpanel::Logger->new();

#-------------------------------------------------------------------------------------------------
# Name:
# get_host_api_key - Gets the host API key as root
# getHostApiKey - Gets the host API key as root
# Desc:
# Gets the host API key as root
# Arguments:
# n/a
# Returns:
# $result1 - string - The host API key
#-------------------------------------------------------------------------------------------------
sub get_host_api_key {
sub getHostApiKey {

my ( $args, $result ) = @_;

Expand All @@ -47,7 +47,7 @@ sub get_host_api_key {
my $admin_bin_call = Cpanel::Wrap::send_cpwrapd_request(
'namespace' => 'CloudFlare',
'module' => 'APIKey',
'function' => 'get_host_api_key',
'function' => 'getHostApiKey',
);

my $host_api_key = $admin_bin_call->{'data'};
Expand Down
4 changes: 2 additions & 2 deletions src/Cpanel/CpanelAPI.php
Expand Up @@ -199,7 +199,7 @@ public function uapiResponseOk($cpanelUApiResponse)
private function sanitizeUApiResponseForLog($cpanelUApiResponse)
{
if ($this->uapiResponseOk($cpanelUApiResponse)) {
if ($cpanelUApiResponse['cpanelresult']['func'] === 'get_host_api_key') {
if ($cpanelUApiResponse['cpanelresult']['func'] === 'getHostApiKey') {
$cpanelUApiResponse['cpanelresult']['result']['data'] = '[HIDDEN]';
}
}
Expand All @@ -223,7 +223,7 @@ public function getHomeDir()
*/
public function getHostAPIKey()
{
return $this->uapi('CloudFlare', 'get_host_api_key', array(), null);
return $this->uapi('CloudFlare', 'getHostApiKey', array(), null);
}

/**
Expand Down

0 comments on commit 5bad444

Please sign in to comment.