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
d5088e81
Commit
d5088e81
authored
Mar 10, 2017
by
Spiros Koulouzis
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
remove commons from provisiponer
parent
d19bb690
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
12 additions
and
18 deletions
+12
-18
pom.xml
drip-provisioner/pom.xml
+0
-5
Consumer.java
.../main/java/nl/uva/sne/drip/drip/provisioner/Consumer.java
+12
-13
No files found.
drip-provisioner/pom.xml
View file @
d5088e81
...
@@ -15,11 +15,6 @@
...
@@ -15,11 +15,6 @@
</properties>
</properties>
<dependencies>
<dependencies>
<dependency>
<groupId>
nl.uva.sne.drip
</groupId>
<artifactId>
drip-commons
</artifactId>
<version>
1.0-SNAPSHOT
</version>
</dependency>
<dependency>
<dependency>
<groupId>
nl.uva.sne.drip
</groupId>
<groupId>
nl.uva.sne.drip
</groupId>
...
...
drip-provisioner/src/main/java/nl/uva/sne/drip/drip/provisioner/Consumer.java
View file @
d5088e81
...
@@ -38,7 +38,6 @@ import java.util.Map;
...
@@ -38,7 +38,6 @@ import java.util.Map;
import
java.util.Properties
;
import
java.util.Properties
;
import
java.util.logging.Level
;
import
java.util.logging.Level
;
import
java.util.logging.Logger
;
import
java.util.logging.Logger
;
import
nl.uva.sne.drip.commons.types.MessageParameter
;
import
org.apache.commons.io.FileUtils
;
import
org.apache.commons.io.FileUtils
;
import
org.apache.commons.io.FilenameUtils
;
import
org.apache.commons.io.FilenameUtils
;
import
org.json.JSONArray
;
import
org.json.JSONArray
;
...
@@ -376,12 +375,12 @@ public class Consumer extends DefaultConsumer {
...
@@ -376,12 +375,12 @@ public class Consumer extends DefaultConsumer {
private
File
getCloudConfigurationFile
(
JSONArray
parameters
,
String
tempInputDirPath
)
throws
JSONException
{
private
File
getCloudConfigurationFile
(
JSONArray
parameters
,
String
tempInputDirPath
)
throws
JSONException
{
for
(
int
i
=
0
;
i
<
parameters
.
length
();
i
++)
{
for
(
int
i
=
0
;
i
<
parameters
.
length
();
i
++)
{
JSONObject
param
=
(
JSONObject
)
parameters
.
get
(
i
);
JSONObject
param
=
(
JSONObject
)
parameters
.
get
(
i
);
String
name
=
(
String
)
param
.
get
(
MessageParameter
.
NAME
);
String
name
=
(
String
)
param
.
get
(
"name"
);
if
(
name
.
equals
(
"ec2.conf"
)
||
name
.
equals
(
"geni.conf"
))
{
if
(
name
.
equals
(
"ec2.conf"
)
||
name
.
equals
(
"geni.conf"
))
{
try
{
try
{
File
confFile
=
new
File
(
tempInputDirPath
+
File
.
separator
+
name
);
File
confFile
=
new
File
(
tempInputDirPath
+
File
.
separator
+
name
);
if
(
confFile
.
createNewFile
())
{
if
(
confFile
.
createNewFile
())
{
writeValueToFile
((
String
)
param
.
get
(
MessageParameter
.
VALUE
),
confFile
);
writeValueToFile
((
String
)
param
.
get
(
"value"
),
confFile
);
return
confFile
;
return
confFile
;
}
else
{
}
else
{
return
null
;
return
null
;
...
@@ -398,7 +397,7 @@ public class Consumer extends DefaultConsumer {
...
@@ -398,7 +397,7 @@ public class Consumer extends DefaultConsumer {
private
File
getTopology
(
JSONArray
parameters
,
String
tempInputDirPath
,
int
level
)
throws
JSONException
,
IOException
{
private
File
getTopology
(
JSONArray
parameters
,
String
tempInputDirPath
,
int
level
)
throws
JSONException
,
IOException
{
for
(
int
i
=
0
;
i
<
parameters
.
length
();
i
++)
{
for
(
int
i
=
0
;
i
<
parameters
.
length
();
i
++)
{
JSONObject
param
=
(
JSONObject
)
parameters
.
get
(
i
);
JSONObject
param
=
(
JSONObject
)
parameters
.
get
(
i
);
String
name
=
(
String
)
param
.
get
(
MessageParameter
.
NAME
);
String
name
=
(
String
)
param
.
get
(
"name"
);
if
(
name
.
equals
(
"topology"
))
{
if
(
name
.
equals
(
"topology"
))
{
JSONObject
attributes
=
param
.
getJSONObject
(
"attributes"
);
JSONObject
attributes
=
param
.
getJSONObject
(
"attributes"
);
int
fileLevel
=
Integer
.
valueOf
((
String
)
attributes
.
get
(
"level"
));
int
fileLevel
=
Integer
.
valueOf
((
String
)
attributes
.
get
(
"level"
));
...
@@ -419,7 +418,7 @@ public class Consumer extends DefaultConsumer {
...
@@ -419,7 +418,7 @@ public class Consumer extends DefaultConsumer {
File
topologyFile
=
new
File
(
tempInputDirPath
+
File
.
separator
+
fileName
);
File
topologyFile
=
new
File
(
tempInputDirPath
+
File
.
separator
+
fileName
);
topologyFile
.
createNewFile
();
topologyFile
.
createNewFile
();
String
val
=
(
String
)
param
.
get
(
MessageParameter
.
VALUE
);
String
val
=
(
String
)
param
.
get
(
"value"
);
writeValueToFile
(
val
,
topologyFile
);
writeValueToFile
(
val
,
topologyFile
);
return
topologyFile
;
return
topologyFile
;
}
}
...
@@ -432,13 +431,13 @@ public class Consumer extends DefaultConsumer {
...
@@ -432,13 +431,13 @@ public class Consumer extends DefaultConsumer {
Map
<
String
,
File
>
files
=
new
HashMap
<>();
Map
<
String
,
File
>
files
=
new
HashMap
<>();
for
(
int
i
=
0
;
i
<
parameters
.
length
();
i
++)
{
for
(
int
i
=
0
;
i
<
parameters
.
length
();
i
++)
{
JSONObject
param
=
(
JSONObject
)
parameters
.
get
(
i
);
JSONObject
param
=
(
JSONObject
)
parameters
.
get
(
i
);
String
name
=
(
String
)
param
.
get
(
MessageParameter
.
NAME
);
String
name
=
(
String
)
param
.
get
(
"name"
);
if
(
name
.
equals
(
"certificate"
))
{
if
(
name
.
equals
(
"certificate"
))
{
JSONObject
attribute
=
param
.
getJSONObject
(
"attributes"
);
JSONObject
attribute
=
param
.
getJSONObject
(
"attributes"
);
String
fileName
=
(
String
)
attribute
.
get
(
"filename"
);
String
fileName
=
(
String
)
attribute
.
get
(
"filename"
);
File
certificate
=
new
File
(
tempInputDirPath
+
File
.
separator
+
fileName
+
".pem"
);
File
certificate
=
new
File
(
tempInputDirPath
+
File
.
separator
+
fileName
+
".pem"
);
if
(
certificate
.
createNewFile
())
{
if
(
certificate
.
createNewFile
())
{
writeValueToFile
((
String
)
param
.
get
(
MessageParameter
.
VALUE
),
certificate
);
writeValueToFile
((
String
)
param
.
get
(
"value"
),
certificate
);
files
.
put
(
fileName
,
certificate
);
files
.
put
(
fileName
,
certificate
);
}
}
}
}
...
@@ -449,9 +448,9 @@ public class Consumer extends DefaultConsumer {
...
@@ -449,9 +448,9 @@ public class Consumer extends DefaultConsumer {
private
String
getLogDirPath
(
JSONArray
parameters
,
String
tempInputDirPath
)
throws
JSONException
{
private
String
getLogDirPath
(
JSONArray
parameters
,
String
tempInputDirPath
)
throws
JSONException
{
for
(
int
i
=
0
;
i
<
parameters
.
length
();
i
++)
{
for
(
int
i
=
0
;
i
<
parameters
.
length
();
i
++)
{
JSONObject
param
=
(
JSONObject
)
parameters
.
get
(
i
);
JSONObject
param
=
(
JSONObject
)
parameters
.
get
(
i
);
String
name
=
(
String
)
param
.
get
(
MessageParameter
.
NAME
);
String
name
=
(
String
)
param
.
get
(
"name"
);
if
(
name
.
equals
(
"logdir"
))
{
if
(
name
.
equals
(
"logdir"
))
{
return
(
String
)
param
.
get
(
MessageParameter
.
VALUE
);
return
(
String
)
param
.
get
(
"value"
);
}
}
}
}
return
System
.
getProperty
(
"java.io.tmpdir"
);
return
System
.
getProperty
(
"java.io.tmpdir"
);
...
@@ -460,9 +459,9 @@ public class Consumer extends DefaultConsumer {
...
@@ -460,9 +459,9 @@ public class Consumer extends DefaultConsumer {
private
File
getSSHKey
(
JSONArray
parameters
,
String
tempInputDirPath
)
throws
JSONException
,
IOException
{
private
File
getSSHKey
(
JSONArray
parameters
,
String
tempInputDirPath
)
throws
JSONException
,
IOException
{
for
(
int
i
=
0
;
i
<
parameters
.
length
();
i
++)
{
for
(
int
i
=
0
;
i
<
parameters
.
length
();
i
++)
{
JSONObject
param
=
(
JSONObject
)
parameters
.
get
(
i
);
JSONObject
param
=
(
JSONObject
)
parameters
.
get
(
i
);
String
name
=
(
String
)
param
.
get
(
MessageParameter
.
NAME
);
String
name
=
(
String
)
param
.
get
(
"name"
);
if
(
name
.
equals
(
"sshkey"
))
{
if
(
name
.
equals
(
"sshkey"
))
{
String
sshKeyContent
=
(
String
)
param
.
get
(
MessageParameter
.
VALUE
);
String
sshKeyContent
=
(
String
)
param
.
get
(
"value"
);
File
sshKeyFile
=
new
File
(
tempInputDirPath
+
File
.
separator
+
"user.pem"
);
File
sshKeyFile
=
new
File
(
tempInputDirPath
+
File
.
separator
+
"user.pem"
);
if
(
sshKeyFile
.
createNewFile
())
{
if
(
sshKeyFile
.
createNewFile
())
{
writeValueToFile
(
sshKeyContent
,
sshKeyFile
);
writeValueToFile
(
sshKeyContent
,
sshKeyFile
);
...
@@ -476,9 +475,9 @@ public class Consumer extends DefaultConsumer {
...
@@ -476,9 +475,9 @@ public class Consumer extends DefaultConsumer {
private
File
getSciptFile
(
JSONArray
parameters
,
String
tempInputDirPath
)
throws
JSONException
,
IOException
{
private
File
getSciptFile
(
JSONArray
parameters
,
String
tempInputDirPath
)
throws
JSONException
,
IOException
{
for
(
int
i
=
0
;
i
<
parameters
.
length
();
i
++)
{
for
(
int
i
=
0
;
i
<
parameters
.
length
();
i
++)
{
JSONObject
param
=
(
JSONObject
)
parameters
.
get
(
i
);
JSONObject
param
=
(
JSONObject
)
parameters
.
get
(
i
);
String
name
=
(
String
)
param
.
get
(
MessageParameter
.
NAME
);
String
name
=
(
String
)
param
.
get
(
"name"
);
if
(
name
.
equals
(
"guiscript"
))
{
if
(
name
.
equals
(
"guiscript"
))
{
String
scriptContent
=
(
String
)
param
.
get
(
MessageParameter
.
VALUE
);
String
scriptContent
=
(
String
)
param
.
get
(
"value"
);
File
scriptFile
=
new
File
(
tempInputDirPath
+
File
.
separator
+
"guiscipt.sh"
);
File
scriptFile
=
new
File
(
tempInputDirPath
+
File
.
separator
+
"guiscipt.sh"
);
if
(
scriptFile
.
createNewFile
())
{
if
(
scriptFile
.
createNewFile
())
{
writeValueToFile
(
scriptContent
,
scriptFile
);
writeValueToFile
(
scriptContent
,
scriptFile
);
...
...
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