diff options
author | 2018-07-25 19:38:18 +0800 | |
---|---|---|
committer | 2018-07-25 19:38:18 +0800 | |
commit | 9213aeb37885de296cc1aa4c2e05aba0a77eadd7 (patch) | |
tree | d0ef11decf5221784caf6c18d6d307aebafc8f48 /openstack-examples/src/main/java/com/woorea/openstack/examples/keystone/KeystoneCreateUser.java | |
parent | b8308fc07ed741b9194b04449347117f2dfb426a (diff) |
refactoring the examples
Issue-ID: SO-729
Change-Id: Iaa750d0a9bf60b9f983c4d83ed4125e221c7fba1
Signed-off-by: seshukm <seshu.kumar.m@huawei.com>
Diffstat (limited to 'openstack-examples/src/main/java/com/woorea/openstack/examples/keystone/KeystoneCreateUser.java')
-rw-r--r-- | openstack-examples/src/main/java/com/woorea/openstack/examples/keystone/KeystoneCreateUser.java | 46 |
1 files changed, 23 insertions, 23 deletions
diff --git a/openstack-examples/src/main/java/com/woorea/openstack/examples/keystone/KeystoneCreateUser.java b/openstack-examples/src/main/java/com/woorea/openstack/examples/keystone/KeystoneCreateUser.java index 0b9392c..e99d1ce 100644 --- a/openstack-examples/src/main/java/com/woorea/openstack/examples/keystone/KeystoneCreateUser.java +++ b/openstack-examples/src/main/java/com/woorea/openstack/examples/keystone/KeystoneCreateUser.java @@ -26,29 +26,29 @@ import com.woorea.openstack.keystone.model.authentication.UsernamePassword; public class KeystoneCreateUser { - /** - * @param args - */ - public static void main(String[] args) { - Keystone keystone = new Keystone(ExamplesConfiguration.KEYSTONE_AUTH_URL); - //access with unscoped token - Access access = keystone.tokens() - .authenticate(new UsernamePassword(ExamplesConfiguration.KEYSTONE_USERNAME, ExamplesConfiguration.KEYSTONE_PASSWORD)) - .withTenantName("admin") - .execute(); + /** + * @param args + */ + public static void main(String[] args) { + Keystone keystone = new Keystone(ExamplesConfiguration.KEYSTONE_AUTH_URL); + //access with unscoped token + Access access = keystone.tokens() + .authenticate(new UsernamePassword(ExamplesConfiguration.KEYSTONE_USERNAME, ExamplesConfiguration.KEYSTONE_PASSWORD)) + .withTenantName("admin") + .execute(); - User user = new User(); - user.setEmail("luis@woorea.es"); - user.setUsername("luis.gervaso"); - user.setPassword("password.0"); - user.setName("Luis"); - user.setEnabled(Boolean.TRUE); + User user = new User(); + user.setEmail("luis@woorea.es"); + user.setUsername("luis.gervaso"); + user.setPassword("password.0"); + user.setName("Luis"); + user.setEnabled(Boolean.TRUE); - keystone = new Keystone("http://keystone.x.org/v2.0"); - keystone.setTokenProvider(new OpenStackSimpleTokenProvider(access.getToken().getId())); - //keystone.enableLogging(Logger.getLogger("keystone"), 10000); - user = keystone.users().create(user).execute(); - System.out.println(user); - keystone.users().delete(user.getId()).execute(); - } + keystone = new Keystone("http://keystone.x.org/v2.0"); + keystone.setTokenProvider(new OpenStackSimpleTokenProvider(access.getToken().getId())); + //keystone.enableLogging(Logger.getLogger("keystone"), 10000); + user = keystone.users().create(user).execute(); + System.out.println(user); + keystone.users().delete(user.getId()).execute(); + } } |