Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
C
CONF
Project
Project
Details
Activity
Releases
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Registry
Registry
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
UvA
CONF
Commits
bdd3f5a5
Commit
bdd3f5a5
authored
Apr 26, 2017
by
Spiros Koulouzis
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
moved data types to separate project
parent
1574a94b
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
17 additions
and
10 deletions
+17
-10
MessageParsing.java
...l/uva/sne/drip/drip/provisioner/utils/MessageParsing.java
+17
-10
No files found.
drip-provisioner/src/main/java/nl/uva/sne/drip/drip/provisioner/utils/MessageParsing.java
View file @
bdd3f5a5
...
...
@@ -46,8 +46,6 @@ import provisioning.credential.EGICredential;
*/
public
class
MessageParsing
{
private
static
ObjectMapper
mapper
;
public
static
List
<
File
>
getTopologies
(
JSONArray
parameters
,
String
tempInputDirPath
,
int
level
)
throws
JSONException
,
IOException
{
List
<
File
>
topologyFiles
=
new
ArrayList
<>();
for
(
int
i
=
0
;
i
<
parameters
.
length
();
i
++)
{
...
...
@@ -117,10 +115,12 @@ public class MessageParsing {
String
name
=
(
String
)
param
.
get
(
"name"
);
if
(
name
.
equals
(
"cloud_credential"
))
{
Credential
credential
=
null
;
mapper
=
new
ObjectMapper
();
ObjectMapper
mapper
=
new
ObjectMapper
();
mapper
.
configure
(
JsonParser
.
Feature
.
ALLOW_SINGLE_QUOTES
,
true
);
String
credentialString
=
(
String
)
param
.
get
(
"value"
);
credentialString
=
credentialString
.
substring
(
1
,
credentialString
.
length
()
-
2
);
System
.
err
.
println
(
credentialString
);
credentialString
=
credentialString
.
substring
(
1
,
credentialString
.
length
()
-
1
);
System
.
err
.
println
(
credentialString
);
CloudCredentials
cred
=
mapper
.
readValue
(
credentialString
,
CloudCredentials
.
class
);
if
(
cred
.
getCloudProviderName
().
toLowerCase
().
equals
(
"ec2"
))
{
EC2Credential
ec2
=
new
EC2Credential
();
...
...
@@ -136,12 +136,19 @@ public class MessageParsing {
}
for
(
KeyPair
pair
:
cred
.
getKeyPairs
())
{
File
dir
=
new
File
(
tempInputDirPath
+
File
.
separator
+
pair
.
getId
());
dir
.
mkdir
();
Key
privateKey
=
pair
.
getPrivateKey
();
writeValueToFile
(
privateKey
.
getKey
(),
new
File
(
dir
.
getAbsolutePath
()
+
File
.
separator
+
privateKey
.
getName
()));
Key
publicKey
=
pair
.
getPublicKey
();
writeValueToFile
(
publicKey
.
getKey
(),
new
File
(
dir
.
getAbsolutePath
()
+
File
.
separator
+
publicKey
.
getName
()));
if
(
pair
!=
null
)
{
File
dir
=
new
File
(
tempInputDirPath
+
File
.
separator
+
pair
.
getId
());
dir
.
mkdir
();
Key
privateKey
=
pair
.
getPrivateKey
();
if
(
privateKey
!=
null
)
{
writeValueToFile
(
privateKey
.
getKey
(),
new
File
(
dir
.
getAbsolutePath
()
+
File
.
separator
+
privateKey
.
getName
()));
}
Key
publicKey
=
pair
.
getPublicKey
();
if
(
publicKey
!=
null
)
{
writeValueToFile
(
publicKey
.
getKey
(),
new
File
(
dir
.
getAbsolutePath
()
+
File
.
separator
+
publicKey
.
getName
()));
}
}
}
credentials
.
add
(
credential
);
}
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment