| FazBrowse GitHub Viewer | Trending | | Home |
| Tools: [Download Repo ZIP] [Original HTTPS Page] |
1 parent c1691a9 commit b2d76ba
1 file changed
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
@@ -76,6 +76,8 @@ public class AgentShell implements IAgentShell, Daemon { | |||
| 76 | 76 | private String connectedHost; | |
| 77 | 77 | private Long preferredHostCheckInterval; | |
| 78 | 78 | ||
| 79 | + static final String LIBVIRT_COMPUTING_RESOURCE = "com.cloud.hypervisor.kvm.resource.LibvirtComputingResource"; | ||
| 80 | + | ||
| 79 | 81 | public AgentShell() { | |
| 80 | 82 | } | |
| 81 | 83 | ||
@@ -375,7 +377,7 @@ public void init(String[] args) throws ConfigurationException { | |||
| 375 | 377 | ||
| 376 | 378 | loadProperties(); | |
| 377 | 379 | parseCommand(args); | |
| 378 | - enableSSL(); | ||
| 380 | + enableSSLForKvmAgent(); | ||
| 379 | 381 | ||
| 380 | 382 | if (s_logger.isDebugEnabled()) { | |
| 381 | 383 | List<String> properties = Collections.list((Enumeration<String>)_properties.propertyNames()); | |
@@ -399,12 +401,17 @@ public void init(String[] args) throws ConfigurationException { | |||
| 399 | 401 | _backoff.configure("ConstantTimeBackoff", new HashMap<String, Object>()); | |
| 400 | 402 | } | |
| 401 | 403 | ||
| 402 | - private void enableSSL() { | ||
| 404 | + private void enableSSLForKvmAgent() { | ||
| 403 | 405 | final File agentFile = PropertiesUtil.findConfigFile("agent.properties"); | |
| 404 | 406 | if (agentFile == null) { | |
| 405 | 407 | s_logger.info("Failed to find agent.properties file"); | |
| 406 | 408 | return; | |
| 407 | 409 | } | |
| 410 | + final String resource = getProperty(null, "resource"); | ||
| 411 | + if (!LIBVIRT_COMPUTING_RESOURCE.equalsIgnoreCase(resource)) { | ||
| 412 | + s_logger.info("This is not a cloudstack kvm agent, ignoring"); | ||
| 413 | + return; | ||
| 414 | + } | ||
| 408 | 415 | String keystorePass = getProperty(null, "keystore.passphrase"); | |
| 409 | 416 | if (StringUtils.isBlank(keystorePass)) { | |
| 410 | 417 | s_logger.info("Failed to find passphrase for keystore: " + KeyStoreUtils.KS_FILENAME); | |
| Back | FazBrowse Home | New Git URL |
0 commit comments