Search in sources :

Example 1 with PingNuageVspCommand

use of com.cloud.agent.api.PingNuageVspCommand in project cloudstack by apache.

the class NuageVspResource method getCurrentStatus.

@Override
public PingCommand getCurrentStatus(long id) {
    if (Strings.isNullOrEmpty(_vspHost.getRestRelativePath())) {
        s_logger.error("Refusing to ping Nuage VSD because the resource configuration is missing the relative path information");
        _shouldAudit = true;
        return null;
    }
    if (Strings.isNullOrEmpty(_vspHost.getCmsUserLogin()) || Strings.isNullOrEmpty(_vspHost.getCmsUserPassword())) {
        s_logger.error("Refusing to ping Nuage VSD because the resource configuration is missing the CMS user information");
        _shouldAudit = true;
        return null;
    }
    try {
        login();
    } catch (ExecutionException | ConfigurationException e) {
        s_logger.error("Failed to ping to Nuage VSD on " + _name + " as user " + _vspHost.getCmsUserLogin(), e);
        _shouldAudit = true;
        return null;
    }
    PingNuageVspCommand pingNuageVspCommand = new PingNuageVspCommand(Host.Type.L2Networking, id, _shouldAudit);
    _shouldAudit = false;
    return pingNuageVspCommand;
}
Also used : PingNuageVspCommand(com.cloud.agent.api.PingNuageVspCommand) ConfigurationException(javax.naming.ConfigurationException) ExecutionException(java.util.concurrent.ExecutionException)

Aggregations

PingNuageVspCommand (com.cloud.agent.api.PingNuageVspCommand)1 ExecutionException (java.util.concurrent.ExecutionException)1 ConfigurationException (javax.naming.ConfigurationException)1