Search in sources :

Example 1 with FileSystemScriptConfig

use of com.sequenceiq.cloudbreak.blueprint.filesystem.FileSystemScriptConfig in project cloudbreak by hortonworks.

the class GcsFileSystemConfigurator method getScriptConfigs.

@Override
protected List<FileSystemScriptConfig> getScriptConfigs(Credential credential, GcsFileSystemConfiguration fsConfig) {
    Map<String, String> properties = Collections.singletonMap("P12KEY", getPrivateKey(credential));
    List<FileSystemScriptConfig> fsScriptConfigs = new ArrayList<>();
    fsScriptConfigs.add(new FileSystemScriptConfig("scripts/gcs-p12.sh", POST_AMBARI_START, ALL_NODES, properties));
    fsScriptConfigs.add(new FileSystemScriptConfig("scripts/gcs-connector-local.sh", POST_AMBARI_START, ALL_NODES));
    fsScriptConfigs.add(new FileSystemScriptConfig("scripts/gcs-connector-hdfs.sh", POST_CLUSTER_INSTALL, ONE_NODE));
    return fsScriptConfigs;
}
Also used : FileSystemScriptConfig(com.sequenceiq.cloudbreak.blueprint.filesystem.FileSystemScriptConfig) ArrayList(java.util.ArrayList)

Example 2 with FileSystemScriptConfig

use of com.sequenceiq.cloudbreak.blueprint.filesystem.FileSystemScriptConfig in project cloudbreak by hortonworks.

the class GcsFileSystemConfiguratorTest method testGetScriptConfigs.

@Test
public void testGetScriptConfigs() throws JsonProcessingException {
    Credential credential = new Credential();
    credential.setAttributes(new Json(singletonMap("serviceAccountPrivateKey", "private-key")));
    GcsFileSystemConfiguration notProcessed = null;
    List<FileSystemScriptConfig> actual = underTest.getScriptConfigs(credential, notProcessed);
    List<FileSystemScriptConfig> expected = Arrays.asList(new FileSystemScriptConfig("scripts/gcs-p12.sh", POST_AMBARI_START, ALL_NODES, singletonMap("P12KEY", "private-key")), new FileSystemScriptConfig("scripts/gcs-connector-local.sh", POST_AMBARI_START, ALL_NODES), new FileSystemScriptConfig("scripts/gcs-connector-hdfs.sh", POST_CLUSTER_INSTALL, ONE_NODE));
    Assert.assertEquals(expected, actual);
}
Also used : Credential(com.sequenceiq.cloudbreak.domain.Credential) FileSystemScriptConfig(com.sequenceiq.cloudbreak.blueprint.filesystem.FileSystemScriptConfig) GcsFileSystemConfiguration(com.sequenceiq.cloudbreak.api.model.GcsFileSystemConfiguration) Json(com.sequenceiq.cloudbreak.domain.json.Json) Test(org.junit.Test)

Example 3 with FileSystemScriptConfig

use of com.sequenceiq.cloudbreak.blueprint.filesystem.FileSystemScriptConfig in project cloudbreak by hortonworks.

the class GcsFileSystemConfiguratorTest method testGetScriptConfigsWhenPrivateKeyNotSet.

@Test
public void testGetScriptConfigsWhenPrivateKeyNotSet() throws JsonProcessingException {
    Credential credential = new Credential();
    credential.setAttributes(new Json(emptyMap()));
    GcsFileSystemConfiguration notProcessed = null;
    List<FileSystemScriptConfig> actual = underTest.getScriptConfigs(credential, notProcessed);
    List<FileSystemScriptConfig> expected = Arrays.asList(new FileSystemScriptConfig("scripts/gcs-p12.sh", POST_AMBARI_START, ALL_NODES, singletonMap("P12KEY", "")), new FileSystemScriptConfig("scripts/gcs-connector-local.sh", POST_AMBARI_START, ALL_NODES), new FileSystemScriptConfig("scripts/gcs-connector-hdfs.sh", POST_CLUSTER_INSTALL, ONE_NODE));
    Assert.assertEquals(expected, actual);
}
Also used : Credential(com.sequenceiq.cloudbreak.domain.Credential) FileSystemScriptConfig(com.sequenceiq.cloudbreak.blueprint.filesystem.FileSystemScriptConfig) GcsFileSystemConfiguration(com.sequenceiq.cloudbreak.api.model.GcsFileSystemConfiguration) Json(com.sequenceiq.cloudbreak.domain.json.Json) Test(org.junit.Test)

Example 4 with FileSystemScriptConfig

use of com.sequenceiq.cloudbreak.blueprint.filesystem.FileSystemScriptConfig in project cloudbreak by hortonworks.

the class WasbFileSystemConfiguratorTest method testGetScriptConfigs.

@Test
public void testGetScriptConfigs() {
    List<FileSystemScriptConfig> actual = underTest.getScriptConfigs(new Credential(), new WasbFileSystemConfiguration());
    Assert.assertEquals(emptyList(), actual);
}
Also used : FileSystemScriptConfig(com.sequenceiq.cloudbreak.blueprint.filesystem.FileSystemScriptConfig) Credential(com.sequenceiq.cloudbreak.domain.Credential) WasbFileSystemConfiguration(com.sequenceiq.cloudbreak.api.model.WasbFileSystemConfiguration) Test(org.junit.Test)

Aggregations

FileSystemScriptConfig (com.sequenceiq.cloudbreak.blueprint.filesystem.FileSystemScriptConfig)4 Credential (com.sequenceiq.cloudbreak.domain.Credential)3 Test (org.junit.Test)3 GcsFileSystemConfiguration (com.sequenceiq.cloudbreak.api.model.GcsFileSystemConfiguration)2 Json (com.sequenceiq.cloudbreak.domain.json.Json)2 WasbFileSystemConfiguration (com.sequenceiq.cloudbreak.api.model.WasbFileSystemConfiguration)1 ArrayList (java.util.ArrayList)1