jclouds-notifications mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Andrew Phillips <notificati...@github.com>
Subject Re: [jclouds/jclouds-examples] update blobstore-basics to use 2.0.0 (#90)
Date Thu, 24 Nov 2016 16:53:38 GMT
demobox requested changes on this pull request.



>        // note that you can check if a provider is present ahead of time
       checkArgument(contains(allKeys, provider), "provider %s not in supported list: %s",
provider, allKeys);
-
-      String identity = args[1];
-      String credential = args[2];
-      String containerName = args[3];
+      identity = parameters.get(1);
+      credential = parameters.get(2);
+      containerName = parameters.get(3);
+      if (parameters.size() > 4) endpoint = parameters.get(4);
+      if (parameters.size() > 5) isSwiftv1 = Boolean.parseBoolean(parameters.get(5));

Rather odd provider-specific argument here? Is there some other way we can get this information,
e.g. from the provider name?

>  
       // Init
-      BlobStoreContext context = ContextBuilder.newBuilder(provider)
-                                               .credentials(identity, credential)
-                                               .buildView(BlobStoreContext.class);
+      ContextBuilder contextBuilder = ContextBuilder.newBuilder(provider)
+              .credentials(identity, credential);
+      if (isSwiftv1) {
+         Properties properties = new Properties();
+         properties.setProperty("jclouds.keystone.credential-type", "tempAuthCredentials");

Can we add instructions to the README to somehow set this property when using Swift v1? Or
change the 6th argument to be less Swift-specific, and more like "if you set this argument,
we will add it as a property"?. Then you might invoke this as:
```
java -jar .... jclouds.keystone.credential-type=tempAuthCredentials
```
rather than:
```
java -jar .... true
```
?

>           Location location = null;
          if (apiMetadata instanceof SwiftApiMetadata) {
             location = Iterables.getFirst(blobStore.listAssignableLocations(), null);
          }
-         blobStore.createContainerInLocation(location, containerName);
+         blobStore.createContainerInLocation(null, containerName);

Is `location` above ignored now? If so, move lines 112-115 to where it is first used, or remove
if unneeded?

-- 
You are receiving this because you are subscribed to this thread.
Reply to this email directly or view it on GitHub:
https://github.com/jclouds/jclouds-examples/pull/90#pullrequestreview-10070898
Mime
View raw message