mirror of
https://github.com/OpenNebula/one.git
synced 2025-03-15 18:50:09 +03:00
Fix unused variable in function
This commit is contained in:
parent
7cb203760e
commit
6748d19d14
@ -94,7 +94,7 @@ private:
|
||||
|
||||
void set_one_endpoint(string endpoint);
|
||||
|
||||
int read_oneauth(string &secret);
|
||||
void read_oneauth(string &secret);
|
||||
};
|
||||
|
||||
#endif /*ONECLIENT_H_*/
|
||||
|
@ -38,11 +38,9 @@ const int Client::MESSAGE_SIZE = 51200;
|
||||
|
||||
void Client::set_one_auth(string secret)
|
||||
{
|
||||
int rc = 0;
|
||||
|
||||
if( secret == "" )
|
||||
if (secret.empty())
|
||||
{
|
||||
rc = read_oneauth(secret);
|
||||
read_oneauth(secret);
|
||||
}
|
||||
|
||||
one_auth = secret;
|
||||
@ -51,7 +49,7 @@ void Client::set_one_auth(string secret)
|
||||
/* -------------------------------------------------------------------------- */
|
||||
/* -------------------------------------------------------------------------- */
|
||||
|
||||
int Client::read_oneauth(string &secret)
|
||||
void Client::read_oneauth(string &secret)
|
||||
{
|
||||
ostringstream oss;
|
||||
string one_auth_file;
|
||||
@ -59,7 +57,7 @@ int Client::read_oneauth(string &secret)
|
||||
const char * one_auth_env;
|
||||
ifstream file;
|
||||
|
||||
bool rc = -1;
|
||||
int rc = -1;
|
||||
|
||||
// Read $ONE_AUTH file and copy its contents into secret.
|
||||
one_auth_env = getenv("ONE_AUTH");
|
||||
@ -111,8 +109,6 @@ int Client::read_oneauth(string &secret)
|
||||
NebulaLog::log("XMLRPC",Log::ERROR,oss);
|
||||
throw runtime_error( oss.str() );
|
||||
}
|
||||
|
||||
return rc;
|
||||
}
|
||||
|
||||
/* -------------------------------------------------------------------------- */
|
||||
|
Loading…
x
Reference in New Issue
Block a user