neptune 0.2.1 → 0.2.2

Sign up to get free protection for your applications and to get access to all the features.
Files changed (61) hide show
  1. data/README +4 -0
  2. data/doc/BabelHelper.html +393 -376
  3. data/doc/BadConfigurationException.html +121 -127
  4. data/doc/CommonFunctions.html +237 -265
  5. data/doc/ExodusHelper.html +820 -0
  6. data/doc/ExodusTaskInfo.html +263 -0
  7. data/doc/FileNotFoundException.html +121 -127
  8. data/doc/NeptuneHelper.html +527 -592
  9. data/doc/NeptuneManagerClient.html +696 -0
  10. data/doc/NeptuneManagerException.html +139 -0
  11. data/doc/Object.html +334 -236
  12. data/doc/TaskInfo.html +428 -0
  13. data/doc/created.rid +8 -5
  14. data/doc/images/add.png +0 -0
  15. data/doc/images/delete.png +0 -0
  16. data/doc/images/tag_blue.png +0 -0
  17. data/doc/images/transparent.png +0 -0
  18. data/doc/index.html +74 -142
  19. data/doc/js/darkfish.js +99 -62
  20. data/doc/js/jquery.js +15 -29
  21. data/doc/js/navigation.js +142 -0
  22. data/doc/js/search.js +94 -0
  23. data/doc/js/search_index.js +1 -0
  24. data/doc/js/searcher.js +228 -0
  25. data/doc/table_of_contents.html +226 -0
  26. data/lib/babel.rb +116 -50
  27. data/lib/custom_exceptions.rb +2 -2
  28. data/lib/exodus.rb +311 -0
  29. data/lib/exodus_task_info.rb +36 -0
  30. data/lib/neptune.rb +52 -18
  31. data/lib/{app_controller_client.rb → neptune_manager_client.rb} +54 -38
  32. data/lib/task_info.rb +155 -0
  33. data/test/{unit/test_babel.rb → test_babel.rb} +161 -26
  34. data/test/{unit/test_common_functions.rb → test_common_functions.rb} +1 -1
  35. data/test/test_exodus.rb +687 -0
  36. data/test/{unit/test_neptune.rb → test_neptune.rb} +28 -17
  37. data/test/{unit/test_app_controller_client.rb → test_neptune_manager_client.rb} +15 -16
  38. data/test/test_task_info.rb +32 -0
  39. data/test/{unit/ts_all.rb → ts_all.rb} +3 -1
  40. metadata +30 -34
  41. data/doc/AppControllerClient.html +0 -702
  42. data/doc/AppControllerException.html +0 -145
  43. data/doc/bin/neptune.html +0 -56
  44. data/doc/js/quicksearch.js +0 -114
  45. data/doc/js/thickbox-compressed.js +0 -10
  46. data/doc/lib/app_controller_client_rb.html +0 -60
  47. data/doc/lib/babel_rb.html +0 -68
  48. data/doc/lib/common_functions_rb.html +0 -70
  49. data/doc/lib/custom_exceptions_rb.html +0 -54
  50. data/doc/lib/neptune_rb.html +0 -60
  51. data/test/integration/tc_c.rb +0 -57
  52. data/test/integration/tc_dfsp.rb +0 -37
  53. data/test/integration/tc_dwssa.rb +0 -38
  54. data/test/integration/tc_erlang.rb +0 -183
  55. data/test/integration/tc_mapreduce.rb +0 -282
  56. data/test/integration/tc_mpi.rb +0 -160
  57. data/test/integration/tc_storage.rb +0 -209
  58. data/test/integration/tc_upc.rb +0 -75
  59. data/test/integration/tc_x10.rb +0 -94
  60. data/test/integration/test_helper.rb +0 -135
  61. data/test/integration/ts_neptune.rb +0 -40
@@ -1,145 +1,139 @@
1
- <?xml version="1.0" encoding="UTF-8"?>
2
- <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN"
3
- "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">
4
- <html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en" lang="en">
1
+ <!DOCTYPE html>
2
+
3
+ <html>
5
4
  <head>
6
- <meta content="text/html; charset=UTF-8" http-equiv="Content-Type" />
7
-
8
- <title>Class: BadConfigurationException</title>
9
-
10
- <link rel="stylesheet" href="./rdoc.css" type="text/css" media="screen" />
11
-
12
- <script src="./js/jquery.js" type="text/javascript"
13
- charset="utf-8"></script>
14
- <script src="./js/thickbox-compressed.js" type="text/javascript"
15
- charset="utf-8"></script>
16
- <script src="./js/quicksearch.js" type="text/javascript"
17
- charset="utf-8"></script>
18
- <script src="./js/darkfish.js" type="text/javascript"
19
- charset="utf-8"></script>
20
-
21
- </head>
22
- <body class="class">
23
-
24
- <div id="metadata">
25
- <div id="home-metadata">
26
- <div id="home-section" class="section">
27
- <h3 class="section-header">
28
- <a href="./index.html">Home</a>
29
- <a href="./index.html#classes">Classes</a>
30
- <a href="./index.html#methods">Methods</a>
31
- </h3>
32
- </div>
33
- </div>
34
-
35
- <div id="file-metadata">
36
- <div id="file-list-section" class="section">
37
- <h3 class="section-header">In Files</h3>
38
- <div class="section-body">
39
- <ul>
40
-
41
- <li><a href="./lib/custom_exceptions_rb.html?TB_iframe=true&amp;height=550&amp;width=785"
42
- class="thickbox" title="lib/custom_exceptions.rb">lib/custom_exceptions.rb</a></li>
43
-
44
- </ul>
45
- </div>
46
- </div>
47
-
48
-
49
- </div>
50
-
51
- <div id="class-metadata">
52
-
53
- <!-- Parent Class -->
54
-
55
- <div id="parent-class-section" class="section">
56
- <h3 class="section-header">Parent</h3>
57
-
58
- <p class="link">Exception</p>
59
-
60
- </div>
61
-
62
-
63
- <!-- Namespace Contents -->
64
-
65
-
66
- <!-- Method Quickref -->
67
-
68
-
69
- <!-- Included Modules -->
70
-
71
- </div>
72
-
73
- <div id="project-metadata">
74
-
75
-
76
-
77
- <div id="classindex-section" class="section project-section">
78
- <h3 class="section-header">Class/Module Index
79
- <span class="search-toggle"><img src="./images/find.png"
80
- height="16" width="16" alt="[+]"
81
- title="show/hide quicksearch" /></span></h3>
82
- <form action="#" method="get" accept-charset="utf-8" class="initially-hidden">
83
- <fieldset>
84
- <legend>Quicksearch</legend>
85
- <input type="text" name="quicksearch" value=""
86
- class="quicksearch-field" />
87
- </fieldset>
88
- </form>
89
-
90
- <ul class="link-list">
91
-
92
- <li><a href="./AppControllerClient.html">AppControllerClient</a></li>
93
-
94
- <li><a href="./AppControllerException.html">AppControllerException</a></li>
95
-
96
- <li><a href="./BabelHelper.html">BabelHelper</a></li>
97
-
98
- <li><a href="./BadConfigurationException.html">BadConfigurationException</a></li>
99
-
100
- <li><a href="./CommonFunctions.html">CommonFunctions</a></li>
101
-
102
- <li><a href="./FileNotFoundException.html">FileNotFoundException</a></li>
103
-
104
- <li><a href="./NeptuneHelper.html">NeptuneHelper</a></li>
105
-
106
- <li><a href="./Object.html">Object</a></li>
107
-
108
- </ul>
109
- <div id="no-class-search-results" style="display: none;">No matching classes.</div>
110
- </div>
111
-
112
-
113
- </div>
5
+ <meta content="text/html; charset=UTF-8" http-equiv="Content-Type">
6
+
7
+ <title>class BadConfigurationException - RDoc Documentation</title>
8
+
9
+ <link type="text/css" media="screen" href="./rdoc.css" rel="stylesheet">
10
+
11
+ <script type="text/javascript">
12
+ var rdoc_rel_prefix = "./";
13
+ </script>
14
+
15
+ <script type="text/javascript" charset="utf-8" src="./js/jquery.js"></script>
16
+ <script type="text/javascript" charset="utf-8" src="./js/navigation.js"></script>
17
+ <script type="text/javascript" charset="utf-8" src="./js/search_index.js"></script>
18
+ <script type="text/javascript" charset="utf-8" src="./js/search.js"></script>
19
+ <script type="text/javascript" charset="utf-8" src="./js/searcher.js"></script>
20
+ <script type="text/javascript" charset="utf-8" src="./js/darkfish.js"></script>
21
+
22
+
23
+ <body id="top" class="class">
24
+ <nav id="metadata">
25
+ <nav id="home-section" class="section">
26
+ <h3 class="section-header">
27
+ <a href="./index.html">Home</a>
28
+ <a href="./table_of_contents.html#classes">Classes</a>
29
+ <a href="./table_of_contents.html#methods">Methods</a>
30
+ </h3>
31
+ </nav>
32
+
33
+
34
+ <nav id="search-section" class="section project-section" class="initially-hidden">
35
+ <form action="#" method="get" accept-charset="utf-8">
36
+ <h3 class="section-header">
37
+ <input type="text" name="search" placeholder="Search" id="search-field"
38
+ title="Type to search, Up and Down to navigate, Enter to load">
39
+ </h3>
40
+ </form>
41
+
42
+ <ul id="search-results" class="initially-hidden"></ul>
43
+ </nav>
44
+
45
+
46
+ <div id="file-metadata">
47
+ <nav id="file-list-section" class="section">
48
+ <h3 class="section-header">Defined In</h3>
49
+ <ul>
50
+ <li>lib/custom_exceptions.rb
51
+ </ul>
52
+ </nav>
53
+
54
+
114
55
  </div>
115
56
 
116
- <div id="documentation">
117
- <h1 class="class">BadConfigurationException</h1>
57
+ <div id="class-metadata">
58
+
59
+ <nav id="parent-class-section" class="section">
60
+ <h3 class="section-header">Parent</h3>
61
+
62
+ <p class="link">Exception
63
+
64
+ </nav>
118
65
 
119
- <div id="description">
120
-
66
+
67
+
68
+ </div>
69
+
70
+ <div id="project-metadata">
71
+
72
+ <nav id="classindex-section" class="section project-section">
73
+ <h3 class="section-header">Class and Module Index</h3>
74
+
75
+ <ul class="link-list">
76
+
77
+ <li><a href="./BabelHelper.html">BabelHelper</a>
78
+
79
+ <li><a href="./BadConfigurationException.html">BadConfigurationException</a>
80
+
81
+ <li><a href="./CommonFunctions.html">CommonFunctions</a>
82
+
83
+ <li><a href="./ExodusHelper.html">ExodusHelper</a>
84
+
85
+ <li><a href="./ExodusTaskInfo.html">ExodusTaskInfo</a>
86
+
87
+ <li><a href="./FileNotFoundException.html">FileNotFoundException</a>
88
+
89
+ <li><a href="./NeptuneHelper.html">NeptuneHelper</a>
90
+
91
+ <li><a href="./NeptuneManagerClient.html">NeptuneManagerClient</a>
92
+
93
+ <li><a href="./NeptuneManagerException.html">NeptuneManagerException</a>
94
+
95
+ <li><a href="./Object.html">Object</a>
96
+
97
+ <li><a href="./TaskInfo.html">TaskInfo</a>
98
+
99
+ </ul>
100
+ </nav>
101
+
102
+ </div>
103
+ </nav>
104
+
105
+ <div id="documentation">
106
+ <h1 class="class">class BadConfigurationException</h1>
107
+
108
+ <div id="description" class="description">
109
+
121
110
  <p>A class of exceptions that are thrown when the user tries to run a Neptune
122
111
  job but fails to give us the correct parameters to do so.</p>
123
112
 
124
- </div>
113
+ </div><!-- description -->
114
+
115
+
116
+
117
+
118
+ <section id="5Buntitled-5D" class="documentation-section">
119
+
120
+
121
+
125
122
 
126
- <!-- Constants -->
127
123
 
128
124
 
129
- <!-- Attributes -->
130
125
 
131
126
 
132
127
  <!-- Methods -->
133
128
 
129
+ </section><!-- 5Buntitled-5D -->
134
130
 
135
- </div>
131
+ </div><!-- documentation -->
136
132
 
137
- <div id="validator-badges">
138
- <p><small><a href="http://validator.w3.org/check/referer">[Validate]</a></small></p>
139
- <p><small>Generated with the <a href="http://deveiate.org/projects/Darkfish-Rdoc/">Darkfish
140
- Rdoc Generator</a> 2</small>.</p>
141
- </div>
142
133
 
143
- </body>
144
- </html>
134
+ <footer id="validator-badges">
135
+ <p><a href="http://validator.w3.org/check/referer">[Validate]</a>
136
+ <p>Generated by <a href="https://github.com/rdoc/rdoc">RDoc</a> 3.12.
137
+ <p>Generated with the <a href="http://deveiate.org/projects/Darkfish-Rdoc/">Darkfish Rdoc Generator</a> 3.
138
+ </footer>
145
139
 
@@ -1,158 +1,153 @@
1
- <?xml version="1.0" encoding="UTF-8"?>
2
- <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN"
3
- "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">
4
- <html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en" lang="en">
1
+ <!DOCTYPE html>
2
+
3
+ <html>
5
4
  <head>
6
- <meta content="text/html; charset=UTF-8" http-equiv="Content-Type" />
7
-
8
- <title>Module: CommonFunctions</title>
9
-
10
- <link rel="stylesheet" href="./rdoc.css" type="text/css" media="screen" />
11
-
12
- <script src="./js/jquery.js" type="text/javascript"
13
- charset="utf-8"></script>
14
- <script src="./js/thickbox-compressed.js" type="text/javascript"
15
- charset="utf-8"></script>
16
- <script src="./js/quicksearch.js" type="text/javascript"
17
- charset="utf-8"></script>
18
- <script src="./js/darkfish.js" type="text/javascript"
19
- charset="utf-8"></script>
20
-
21
- </head>
22
- <body class="module">
23
-
24
- <div id="metadata">
25
- <div id="home-metadata">
26
- <div id="home-section" class="section">
27
- <h3 class="section-header">
28
- <a href="./index.html">Home</a>
29
- <a href="./index.html#classes">Classes</a>
30
- <a href="./index.html#methods">Methods</a>
31
- </h3>
32
- </div>
33
- </div>
34
-
35
- <div id="file-metadata">
36
- <div id="file-list-section" class="section">
37
- <h3 class="section-header">In Files</h3>
38
- <div class="section-body">
39
- <ul>
40
-
41
- <li><a href="./lib/common_functions_rb.html?TB_iframe=true&amp;height=550&amp;width=785"
42
- class="thickbox" title="lib/common_functions.rb">lib/common_functions.rb</a></li>
43
-
44
- </ul>
45
- </div>
46
- </div>
5
+ <meta content="text/html; charset=UTF-8" http-equiv="Content-Type">
47
6
 
48
-
49
- </div>
7
+ <title>module CommonFunctions - RDoc Documentation</title>
50
8
 
51
- <div id="class-metadata">
9
+ <link type="text/css" media="screen" href="./rdoc.css" rel="stylesheet">
52
10
 
53
- <!-- Parent Class -->
54
-
11
+ <script type="text/javascript">
12
+ var rdoc_rel_prefix = "./";
13
+ </script>
55
14
 
56
- <!-- Namespace Contents -->
57
-
15
+ <script type="text/javascript" charset="utf-8" src="./js/jquery.js"></script>
16
+ <script type="text/javascript" charset="utf-8" src="./js/navigation.js"></script>
17
+ <script type="text/javascript" charset="utf-8" src="./js/search_index.js"></script>
18
+ <script type="text/javascript" charset="utf-8" src="./js/search.js"></script>
19
+ <script type="text/javascript" charset="utf-8" src="./js/searcher.js"></script>
20
+ <script type="text/javascript" charset="utf-8" src="./js/darkfish.js"></script>
58
21
 
59
- <!-- Method Quickref -->
60
-
61
- <div id="method-list-section" class="section">
62
- <h3 class="section-header">Methods</h3>
63
- <ul class="link-list">
64
-
65
- <li><a href="#method-c-get_from_yaml">::get_from_yaml</a></li>
66
-
67
- <li><a href="#method-c-get_random_alphanumeric">::get_random_alphanumeric</a></li>
68
-
69
- <li><a href="#method-c-get_secret_key">::get_secret_key</a></li>
70
-
71
- <li><a href="#method-c-scp_file">::scp_file</a></li>
72
-
73
- <li><a href="#method-c-scp_to_shadow">::scp_to_shadow</a></li>
74
-
75
- <li><a href="#method-c-shell">::shell</a></li>
76
-
77
- </ul>
78
- </div>
79
-
80
-
81
- <!-- Included Modules -->
82
-
83
- </div>
84
-
85
- <div id="project-metadata">
86
-
87
-
88
-
89
- <div id="classindex-section" class="section project-section">
90
- <h3 class="section-header">Class/Module Index
91
- <span class="search-toggle"><img src="./images/find.png"
92
- height="16" width="16" alt="[+]"
93
- title="show/hide quicksearch" /></span></h3>
94
- <form action="#" method="get" accept-charset="utf-8" class="initially-hidden">
95
- <fieldset>
96
- <legend>Quicksearch</legend>
97
- <input type="text" name="quicksearch" value=""
98
- class="quicksearch-field" />
99
- </fieldset>
100
- </form>
101
-
102
- <ul class="link-list">
103
-
104
- <li><a href="./AppControllerClient.html">AppControllerClient</a></li>
105
-
106
- <li><a href="./AppControllerException.html">AppControllerException</a></li>
107
-
108
- <li><a href="./BabelHelper.html">BabelHelper</a></li>
109
-
110
- <li><a href="./BadConfigurationException.html">BadConfigurationException</a></li>
111
-
112
- <li><a href="./CommonFunctions.html">CommonFunctions</a></li>
113
-
114
- <li><a href="./FileNotFoundException.html">FileNotFoundException</a></li>
115
-
116
- <li><a href="./NeptuneHelper.html">NeptuneHelper</a></li>
117
-
118
- <li><a href="./Object.html">Object</a></li>
119
-
120
- </ul>
121
- <div id="no-class-search-results" style="display: none;">No matching classes.</div>
122
- </div>
123
22
 
124
-
125
- </div>
23
+ <body id="top" class="module">
24
+ <nav id="metadata">
25
+ <nav id="home-section" class="section">
26
+ <h3 class="section-header">
27
+ <a href="./index.html">Home</a>
28
+ <a href="./table_of_contents.html#classes">Classes</a>
29
+ <a href="./table_of_contents.html#methods">Methods</a>
30
+ </h3>
31
+ </nav>
32
+
33
+
34
+ <nav id="search-section" class="section project-section" class="initially-hidden">
35
+ <form action="#" method="get" accept-charset="utf-8">
36
+ <h3 class="section-header">
37
+ <input type="text" name="search" placeholder="Search" id="search-field"
38
+ title="Type to search, Up and Down to navigate, Enter to load">
39
+ </h3>
40
+ </form>
41
+
42
+ <ul id="search-results" class="initially-hidden"></ul>
43
+ </nav>
44
+
45
+
46
+ <div id="file-metadata">
47
+ <nav id="file-list-section" class="section">
48
+ <h3 class="section-header">Defined In</h3>
49
+ <ul>
50
+ <li>lib/common_functions.rb
51
+ </ul>
52
+ </nav>
53
+
54
+
55
+ </div>
56
+
57
+ <div id="class-metadata">
58
+
59
+
60
+
61
+ <!-- Method Quickref -->
62
+ <nav id="method-list-section" class="section">
63
+ <h3 class="section-header">Methods</h3>
64
+
65
+ <ul class="link-list">
66
+
67
+ <li><a href="#method-c-get_from_yaml">::get_from_yaml</a>
68
+
69
+ <li><a href="#method-c-get_random_alphanumeric">::get_random_alphanumeric</a>
70
+
71
+ <li><a href="#method-c-get_secret_key">::get_secret_key</a>
72
+
73
+ <li><a href="#method-c-scp_file">::scp_file</a>
74
+
75
+ <li><a href="#method-c-scp_to_shadow">::scp_to_shadow</a>
76
+
77
+ <li><a href="#method-c-shell">::shell</a>
78
+
79
+ </ul>
80
+ </nav>
81
+
82
+ </div>
83
+
84
+ <div id="project-metadata">
85
+
86
+ <nav id="classindex-section" class="section project-section">
87
+ <h3 class="section-header">Class and Module Index</h3>
88
+
89
+ <ul class="link-list">
90
+
91
+ <li><a href="./BabelHelper.html">BabelHelper</a>
92
+
93
+ <li><a href="./BadConfigurationException.html">BadConfigurationException</a>
94
+
95
+ <li><a href="./CommonFunctions.html">CommonFunctions</a>
96
+
97
+ <li><a href="./ExodusHelper.html">ExodusHelper</a>
98
+
99
+ <li><a href="./ExodusTaskInfo.html">ExodusTaskInfo</a>
100
+
101
+ <li><a href="./FileNotFoundException.html">FileNotFoundException</a>
102
+
103
+ <li><a href="./NeptuneHelper.html">NeptuneHelper</a>
104
+
105
+ <li><a href="./NeptuneManagerClient.html">NeptuneManagerClient</a>
106
+
107
+ <li><a href="./NeptuneManagerException.html">NeptuneManagerException</a>
108
+
109
+ <li><a href="./Object.html">Object</a>
110
+
111
+ <li><a href="./TaskInfo.html">TaskInfo</a>
112
+
113
+ </ul>
114
+ </nav>
115
+
126
116
  </div>
117
+ </nav>
127
118
 
128
- <div id="documentation">
129
- <h1 class="module">CommonFunctions</h1>
119
+ <div id="documentation">
120
+ <h1 class="module">module CommonFunctions</h1>
130
121
 
131
- <div id="description">
132
-
122
+ <div id="description" class="description">
123
+
133
124
  <p>A helper module that aggregates functions that are not part of Neptune’s
134
125
  core functionality. Specifically, this module contains methods to scp files
135
126
  to other machines and the ability to read YAML files, which are often
136
127
  needed to determine which machine should be used for computation or to copy
137
128
  over code and input files.</p>
138
129
 
139
- </div>
130
+ </div><!-- description -->
131
+
132
+
133
+
134
+
135
+ <section id="5Buntitled-5D" class="documentation-section">
136
+
137
+
138
+
140
139
 
141
- <!-- Constants -->
142
140
 
143
141
 
144
- <!-- Attributes -->
145
142
 
146
143
 
147
144
  <!-- Methods -->
148
145
 
149
- <div id="public-class-method-details" class="method-section section">
146
+ <section id="public-class-5Buntitled-5D-method-details" class="method-section section">
150
147
  <h3 class="section-header">Public Class Methods</h3>
151
148
 
152
149
 
153
- <div id="get_from_yaml-method" class="method-detail ">
154
- <a name="method-c-get_from_yaml"></a>
155
-
150
+ <div id="method-c-get_from_yaml" class="method-detail ">
156
151
 
157
152
  <div class="method-heading">
158
153
  <span class="method-name">get_from_yaml</span><span
@@ -172,52 +167,48 @@ instead.</p>
172
167
 
173
168
 
174
169
 
175
- <div class="method-source-code"
176
- id="get_from_yaml-source">
177
- <pre>
178
- <span class="ruby-comment"># File lib/common_functions.rb, line 108</span>
179
- def self.get_from_yaml(keyname, tag, required=true)
180
- location_file = <span class="ruby-constant">File</span>.expand_path(&quot;~/.appscale/locations-#{keyname}.yaml&quot;)
181
-
182
- if !<span class="ruby-constant">File</span>.exists?(location_file)
183
- raise <span class="ruby-constant">BadConfigurationException</span>.new(<span class="ruby-string">&quot;An AppScale instance is not &quot;</span> +
184
- &quot;currently running with the provided keyname, \&quot;#{keyname}\&quot;.&quot;)
185
- end
170
+ <div class="method-source-code" id="get_from_yaml-source">
171
+ <pre><span class="ruby-comment"># File lib/common_functions.rb, line 108</span>
172
+ <span class="ruby-keyword">def</span> <span class="ruby-keyword">self</span>.<span class="ruby-identifier">get_from_yaml</span>(<span class="ruby-identifier">keyname</span>, <span class="ruby-identifier">tag</span>, <span class="ruby-identifier">required</span>=<span class="ruby-keyword">true</span>)
173
+ <span class="ruby-identifier">location_file</span> = <span class="ruby-constant">File</span>.<span class="ruby-identifier">expand_path</span>(<span class="ruby-node">&quot;~/.appscale/locations-#{keyname}.yaml&quot;</span>)
174
+
175
+ <span class="ruby-keyword">if</span> <span class="ruby-operator">!</span><span class="ruby-constant">File</span>.<span class="ruby-identifier">exists?</span>(<span class="ruby-identifier">location_file</span>)
176
+ <span class="ruby-identifier">raise</span> <span class="ruby-constant">BadConfigurationException</span>.<span class="ruby-identifier">new</span>(<span class="ruby-string">&quot;An AppScale instance is not &quot;</span> <span class="ruby-operator">+</span>
177
+ <span class="ruby-node">&quot;currently running with the provided keyname, \&quot;#{keyname}\&quot;.&quot;</span>)
178
+ <span class="ruby-keyword">end</span>
186
179
 
187
- begin
188
- tree = <span class="ruby-constant">YAML</span>.load_file(location_file)
189
- rescue <span class="ruby-constant">ArgumentError</span>
190
- if required
191
- abort(<span class="ruby-string">&quot;The yaml file you provided was malformed. Please correct any&quot;</span> +
180
+ <span class="ruby-keyword">begin</span>
181
+ <span class="ruby-identifier">tree</span> = <span class="ruby-constant">YAML</span>.<span class="ruby-identifier">load_file</span>(<span class="ruby-identifier">location_file</span>)
182
+ <span class="ruby-keyword">rescue</span> <span class="ruby-constant">ArgumentError</span>
183
+ <span class="ruby-keyword">if</span> <span class="ruby-identifier">required</span>
184
+ <span class="ruby-identifier">abort</span>(<span class="ruby-string">&quot;The yaml file you provided was malformed. Please correct any&quot;</span> <span class="ruby-operator">+</span>
192
185
  <span class="ruby-string">&quot; errors in it and try again.&quot;</span>)
193
- else
194
- return nil
195
- end
196
- end
186
+ <span class="ruby-keyword">else</span>
187
+ <span class="ruby-keyword">return</span> <span class="ruby-keyword">nil</span>
188
+ <span class="ruby-keyword">end</span>
189
+ <span class="ruby-keyword">end</span>
197
190
 
198
- value = tree[tag]
191
+ <span class="ruby-identifier">value</span> = <span class="ruby-identifier">tree</span>[<span class="ruby-identifier">tag</span>]
199
192
 
200
- if value.nil? and required
201
- abort(&quot;The file #{location_file} is in the wrong format and doesn't&quot; +
202
- &quot; contain a #{tag} tag. Please make sure the file is in the correct&quot; +
193
+ <span class="ruby-keyword">if</span> <span class="ruby-identifier">value</span>.<span class="ruby-identifier">nil?</span> <span class="ruby-keyword">and</span> <span class="ruby-identifier">required</span>
194
+ <span class="ruby-identifier">abort</span>(<span class="ruby-node">&quot;The file #{location_file} is in the wrong format and doesn't&quot;</span> <span class="ruby-operator">+</span>
195
+ <span class="ruby-node">&quot; contain a #{tag} tag. Please make sure the file is in the correct&quot;</span> <span class="ruby-operator">+</span>
203
196
  <span class="ruby-string">&quot; format and try again.&quot;</span>)
204
- end
197
+ <span class="ruby-keyword">end</span>
205
198
 
206
- return value
207
- end</pre>
208
- </div>
199
+ <span class="ruby-keyword">return</span> <span class="ruby-identifier">value</span>
200
+ <span class="ruby-keyword">end</span></pre>
201
+ </div><!-- get_from_yaml-source -->
209
202
 
210
203
  </div>
211
204
 
212
205
 
213
206
 
214
207
 
215
- </div>
208
+ </div><!-- get_from_yaml-method -->
216
209
 
217
210
 
218
- <div id="get_random_alphanumeric-method" class="method-detail ">
219
- <a name="method-c-get_random_alphanumeric"></a>
220
-
211
+ <div id="method-c-get_random_alphanumeric" class="method-detail ">
221
212
 
222
213
  <div class="method-heading">
223
214
  <span class="method-name">get_random_alphanumeric</span><span
@@ -233,34 +224,30 @@ user requests.</p>
233
224
 
234
225
 
235
226
 
236
- <div class="method-source-code"
237
- id="get_random_alphanumeric-source">
238
- <pre>
239
- <span class="ruby-comment"># File lib/common_functions.rb, line 33</span>
240
- def self.get_random_alphanumeric(length=10)
241
- random = <span class="ruby-string">&quot;&quot;</span>
242
- possible = <span class="ruby-string">&quot;0123456789abcdefghijklmnopqrstuvxwyzABCDEFGHIJKLMNOPQRSTUVWXYZ&quot;</span>
243
- possibleLength = possible.length
227
+ <div class="method-source-code" id="get_random_alphanumeric-source">
228
+ <pre><span class="ruby-comment"># File lib/common_functions.rb, line 33</span>
229
+ <span class="ruby-keyword">def</span> <span class="ruby-keyword">self</span>.<span class="ruby-identifier">get_random_alphanumeric</span>(<span class="ruby-identifier">length</span>=<span class="ruby-value">10</span>)
230
+ <span class="ruby-identifier">random</span> = <span class="ruby-string">&quot;&quot;</span>
231
+ <span class="ruby-identifier">possible</span> = <span class="ruby-string">&quot;0123456789abcdefghijklmnopqrstuvxwyzABCDEFGHIJKLMNOPQRSTUVWXYZ&quot;</span>
232
+ <span class="ruby-identifier">possibleLength</span> = <span class="ruby-identifier">possible</span>.<span class="ruby-identifier">length</span>
244
233
 
245
- length.times { |index|
246
- random &lt;&lt; possible[<span class="ruby-constant">Kernel</span>.rand(possibleLength)]
234
+ <span class="ruby-identifier">length</span>.<span class="ruby-identifier">times</span> { <span class="ruby-operator">|</span><span class="ruby-identifier">index</span><span class="ruby-operator">|</span>
235
+ <span class="ruby-identifier">random</span> <span class="ruby-operator">&lt;&lt;</span> <span class="ruby-identifier">possible</span>[<span class="ruby-constant">Kernel</span>.<span class="ruby-identifier">rand</span>(<span class="ruby-identifier">possibleLength</span>)]
247
236
  }
248
237
 
249
- return random
250
- end</pre>
251
- </div>
238
+ <span class="ruby-keyword">return</span> <span class="ruby-identifier">random</span>
239
+ <span class="ruby-keyword">end</span></pre>
240
+ </div><!-- get_random_alphanumeric-source -->
252
241
 
253
242
  </div>
254
243
 
255
244
 
256
245
 
257
246
 
258
- </div>
247
+ </div><!-- get_random_alphanumeric-method -->
259
248
 
260
249
 
261
- <div id="get_secret_key-method" class="method-detail ">
262
- <a name="method-c-get_secret_key"></a>
263
-
250
+ <div id="method-c-get_secret_key" class="method-detail ">
264
251
 
265
252
  <div class="method-heading">
266
253
  <span class="method-name">get_secret_key</span><span
@@ -273,31 +260,27 @@ end</pre>
273
260
 
274
261
  <p>Returns the secret key needed for communication with AppScale’s Shadow
275
262
  node. This method is a nice frontend to the <a
276
- href="CommonFunctions.html#method-c-get_from_yaml">get_from_yaml</a>
263
+ href="CommonFunctions.html#method-c-get_from_yaml">::get_from_yaml</a>
277
264
  function, as the secret is stored in a YAML file.</p>
278
265
 
279
266
 
280
267
 
281
- <div class="method-source-code"
282
- id="get_secret_key-source">
283
- <pre>
284
- <span class="ruby-comment"># File lib/common_functions.rb, line 142</span>
285
- def self.get_secret_key(keyname, required=true)
286
- return <span class="ruby-constant">CommonFunctions</span>.get_from_yaml(keyname, :secret, required)
287
- end</pre>
288
- </div>
268
+ <div class="method-source-code" id="get_secret_key-source">
269
+ <pre><span class="ruby-comment"># File lib/common_functions.rb, line 142</span>
270
+ <span class="ruby-keyword">def</span> <span class="ruby-keyword">self</span>.<span class="ruby-identifier">get_secret_key</span>(<span class="ruby-identifier">keyname</span>, <span class="ruby-identifier">required</span>=<span class="ruby-keyword">true</span>)
271
+ <span class="ruby-keyword">return</span> <span class="ruby-constant">CommonFunctions</span>.<span class="ruby-identifier">get_from_yaml</span>(<span class="ruby-identifier">keyname</span>, <span class="ruby-value">:secret</span>, <span class="ruby-identifier">required</span>)
272
+ <span class="ruby-keyword">end</span></pre>
273
+ </div><!-- get_secret_key-source -->
289
274
 
290
275
  </div>
291
276
 
292
277
 
293
278
 
294
279
 
295
- </div>
280
+ </div><!-- get_secret_key-method -->
296
281
 
297
282
 
298
- <div id="scp_file-method" class="method-detail ">
299
- <a name="method-c-scp_file"></a>
300
-
283
+ <div id="method-c-scp_file" class="method-detail ">
301
284
 
302
285
  <div class="method-heading">
303
286
  <span class="method-name">scp_file</span><span
@@ -310,7 +293,7 @@ end</pre>
310
293
 
311
294
  <p>Performs the actual remote copying of files: given the IP address and other
312
295
  information from <a
313
- href="CommonFunctions.html#method-c-scp_to_shadow">scp_to_shadow</a>,
296
+ href="CommonFunctions.html#method-c-scp_to_shadow">::scp_to_shadow</a>,
314
297
  attempts to use scp to copy the file over. Aborts if the scp fails, which
315
298
  can occur if the network is down, if a bad keyname is provided, or if the
316
299
  wrong IP is given. If the user specifies that the file to copy is actually
@@ -318,57 +301,53 @@ a directory, we append the -r flag to scp as well.</p>
318
301
 
319
302
 
320
303
 
321
- <div class="method-source-code"
322
- id="scp_file-source">
323
- <pre>
324
- <span class="ruby-comment"># File lib/common_functions.rb, line 66</span>
325
- def self.scp_file(local_file_loc, remote_file_loc, target_ip, public_key_loc,
326
- is_dir=false)
327
-
328
- local_file_loc = <span class="ruby-constant">File</span>.expand_path(local_file_loc)
329
- ssh_args = <span class="ruby-string">&quot;-o StrictHostkeyChecking=no 2&gt;&amp;1&quot;</span>
330
- ssh_args &lt;&lt; <span class="ruby-string">&quot; -r &quot;</span> if is_dir
331
-
332
- public_key_loc = <span class="ruby-constant">File</span>.expand_path(public_key_loc)
333
- cmd = &quot;scp -i #{public_key_loc} #{ssh_args} #{local_file_loc} root@#{target_ip}:#{remote_file_loc}&quot;
334
- cmd &lt;&lt; <span class="ruby-string">&quot;; echo $? &gt;&gt; ~/.appscale/retval&quot;</span>
335
-
336
- retval_loc = <span class="ruby-constant">File</span>.expand_path(<span class="ruby-string">&quot;~/.appscale/retval&quot;</span>)
337
- <span class="ruby-constant">FileUtils</span>.rm_f(retval_loc)
338
-
339
- begin
340
- <span class="ruby-constant">Timeout</span>::timeout(-1) { <span class="ruby-constant">CommonFunctions</span>.shell(&quot;#{cmd}&quot;) }
341
- rescue <span class="ruby-constant">Timeout</span>::<span class="ruby-constant">Error</span>
342
- abort(<span class="ruby-string">&quot;Remotely copying over files failed. Is the destination machine&quot;</span> +
343
- <span class="ruby-string">&quot; on and reachable from this computer? We tried the following&quot;</span> +
344
- &quot; command:\n\n#{cmd}&quot;)
345
- end
346
-
347
- loop {
348
- break if <span class="ruby-constant">File</span>.exists?(retval_loc)
349
- <span class="ruby-constant">Kernel</span>.sleep(5)
304
+ <div class="method-source-code" id="scp_file-source">
305
+ <pre><span class="ruby-comment"># File lib/common_functions.rb, line 66</span>
306
+ <span class="ruby-keyword">def</span> <span class="ruby-keyword">self</span>.<span class="ruby-identifier">scp_file</span>(<span class="ruby-identifier">local_file_loc</span>, <span class="ruby-identifier">remote_file_loc</span>, <span class="ruby-identifier">target_ip</span>, <span class="ruby-identifier">public_key_loc</span>,
307
+ <span class="ruby-identifier">is_dir</span>=<span class="ruby-keyword">false</span>)
308
+
309
+ <span class="ruby-identifier">local_file_loc</span> = <span class="ruby-constant">File</span>.<span class="ruby-identifier">expand_path</span>(<span class="ruby-identifier">local_file_loc</span>)
310
+ <span class="ruby-identifier">ssh_args</span> = <span class="ruby-string">&quot;-o StrictHostkeyChecking=no 2&gt;&amp;1&quot;</span>
311
+ <span class="ruby-identifier">ssh_args</span> <span class="ruby-operator">&lt;&lt;</span> <span class="ruby-string">&quot; -r &quot;</span> <span class="ruby-keyword">if</span> <span class="ruby-identifier">is_dir</span>
312
+
313
+ <span class="ruby-identifier">public_key_loc</span> = <span class="ruby-constant">File</span>.<span class="ruby-identifier">expand_path</span>(<span class="ruby-identifier">public_key_loc</span>)
314
+ <span class="ruby-identifier">cmd</span> = <span class="ruby-node">&quot;scp -i #{public_key_loc} #{ssh_args} #{local_file_loc} root@#{target_ip}:#{remote_file_loc}&quot;</span>
315
+ <span class="ruby-identifier">cmd</span> <span class="ruby-operator">&lt;&lt;</span> <span class="ruby-string">&quot;; echo $? &gt;&gt; ~/.appscale/retval&quot;</span>
316
+
317
+ <span class="ruby-identifier">retval_loc</span> = <span class="ruby-constant">File</span>.<span class="ruby-identifier">expand_path</span>(<span class="ruby-string">&quot;~/.appscale/retval&quot;</span>)
318
+ <span class="ruby-constant">FileUtils</span>.<span class="ruby-identifier">rm_f</span>(<span class="ruby-identifier">retval_loc</span>)
319
+
320
+ <span class="ruby-keyword">begin</span>
321
+ <span class="ruby-constant">Timeout</span><span class="ruby-operator">::</span><span class="ruby-identifier">timeout</span>(<span class="ruby-value">-1</span>) { <span class="ruby-constant">CommonFunctions</span>.<span class="ruby-identifier">shell</span>(<span class="ruby-node">&quot;#{cmd}&quot;</span>) }
322
+ <span class="ruby-keyword">rescue</span> <span class="ruby-constant">Timeout</span><span class="ruby-operator">::</span><span class="ruby-constant">Error</span>
323
+ <span class="ruby-identifier">abort</span>(<span class="ruby-string">&quot;Remotely copying over files failed. Is the destination machine&quot;</span> <span class="ruby-operator">+</span>
324
+ <span class="ruby-string">&quot; on and reachable from this computer? We tried the following&quot;</span> <span class="ruby-operator">+</span>
325
+ <span class="ruby-node">&quot; command:\n\n#{cmd}&quot;</span>)
326
+ <span class="ruby-keyword">end</span>
327
+
328
+ <span class="ruby-identifier">loop</span> {
329
+ <span class="ruby-keyword">break</span> <span class="ruby-keyword">if</span> <span class="ruby-constant">File</span>.<span class="ruby-identifier">exists?</span>(<span class="ruby-identifier">retval_loc</span>)
330
+ <span class="ruby-constant">Kernel</span>.<span class="ruby-identifier">sleep</span>(<span class="ruby-value">5</span>)
350
331
  }
351
332
 
352
- retval = (<span class="ruby-constant">File</span>.open(retval_loc) { |f| f.read }).chomp
353
- if retval != <span class="ruby-string">&quot;0&quot;</span>
354
- abort(&quot;\n\n[#{cmd}] returned #{retval} instead of 0 as expected. Is &quot; +
333
+ <span class="ruby-identifier">retval</span> = (<span class="ruby-constant">File</span>.<span class="ruby-identifier">open</span>(<span class="ruby-identifier">retval_loc</span>) { <span class="ruby-operator">|</span><span class="ruby-identifier">f</span><span class="ruby-operator">|</span> <span class="ruby-identifier">f</span>.<span class="ruby-identifier">read</span> }).<span class="ruby-identifier">chomp</span>
334
+ <span class="ruby-keyword">if</span> <span class="ruby-identifier">retval</span> <span class="ruby-operator">!=</span> <span class="ruby-string">&quot;0&quot;</span>
335
+ <span class="ruby-identifier">abort</span>(<span class="ruby-node">&quot;\n\n[#{cmd}] returned #{retval} instead of 0 as expected. Is &quot;</span> <span class="ruby-operator">+</span>
355
336
  <span class="ruby-string">&quot;your environment set up properly?&quot;</span>)
356
- end
357
- return cmd
358
- end</pre>
359
- </div>
337
+ <span class="ruby-keyword">end</span>
338
+ <span class="ruby-keyword">return</span> <span class="ruby-identifier">cmd</span>
339
+ <span class="ruby-keyword">end</span></pre>
340
+ </div><!-- scp_file-source -->
360
341
 
361
342
  </div>
362
343
 
363
344
 
364
345
 
365
346
 
366
- </div>
347
+ </div><!-- scp_file-method -->
367
348
 
368
349
 
369
- <div id="scp_to_shadow-method" class="method-detail ">
370
- <a name="method-c-scp_to_shadow"></a>
371
-
350
+ <div id="method-c-scp_to_shadow" class="method-detail ">
372
351
 
373
352
  <div class="method-heading">
374
353
  <span class="method-name">scp_to_shadow</span><span
@@ -386,29 +365,25 @@ by the Neptune job given, but defaults to ”appscale” if not provided.</p>
386
365
 
387
366
 
388
367
 
389
- <div class="method-source-code"
390
- id="scp_to_shadow-source">
391
- <pre>
392
- <span class="ruby-comment"># File lib/common_functions.rb, line 52</span>
393
- def self.scp_to_shadow(local_file_loc, remote_file_loc, keyname, is_dir=false)
394
- shadow_ip = <span class="ruby-constant">CommonFunctions</span>.get_from_yaml(keyname, :shadow)
395
- ssh_key = <span class="ruby-constant">File</span>.expand_path(&quot;~/.appscale/#{keyname}.key&quot;)
396
- <span class="ruby-constant">CommonFunctions</span>.scp_file(local_file_loc, remote_file_loc, shadow_ip,
397
- ssh_key, is_dir)
398
- end</pre>
399
- </div>
368
+ <div class="method-source-code" id="scp_to_shadow-source">
369
+ <pre><span class="ruby-comment"># File lib/common_functions.rb, line 52</span>
370
+ <span class="ruby-keyword">def</span> <span class="ruby-keyword">self</span>.<span class="ruby-identifier">scp_to_shadow</span>(<span class="ruby-identifier">local_file_loc</span>, <span class="ruby-identifier">remote_file_loc</span>, <span class="ruby-identifier">keyname</span>, <span class="ruby-identifier">is_dir</span>=<span class="ruby-keyword">false</span>)
371
+ <span class="ruby-identifier">shadow_ip</span> = <span class="ruby-constant">CommonFunctions</span>.<span class="ruby-identifier">get_from_yaml</span>(<span class="ruby-identifier">keyname</span>, <span class="ruby-value">:shadow</span>)
372
+ <span class="ruby-identifier">ssh_key</span> = <span class="ruby-constant">File</span>.<span class="ruby-identifier">expand_path</span>(<span class="ruby-node">&quot;~/.appscale/#{keyname}.key&quot;</span>)
373
+ <span class="ruby-constant">CommonFunctions</span>.<span class="ruby-identifier">scp_file</span>(<span class="ruby-identifier">local_file_loc</span>, <span class="ruby-identifier">remote_file_loc</span>, <span class="ruby-identifier">shadow_ip</span>,
374
+ <span class="ruby-identifier">ssh_key</span>, <span class="ruby-identifier">is_dir</span>)
375
+ <span class="ruby-keyword">end</span></pre>
376
+ </div><!-- scp_to_shadow-source -->
400
377
 
401
378
  </div>
402
379
 
403
380
 
404
381
 
405
382
 
406
- </div>
383
+ </div><!-- scp_to_shadow-method -->
407
384
 
408
385
 
409
- <div id="shell-method" class="method-detail ">
410
- <a name="method-c-shell"></a>
411
-
386
+ <div id="method-c-shell" class="method-detail ">
412
387
 
413
388
  <div class="method-heading">
414
389
  <span class="method-name">shell</span><span
@@ -425,34 +400,31 @@ method).</p>
425
400
 
426
401
 
427
402
 
428
- <div class="method-source-code"
429
- id="shell-source">
430
- <pre>
431
- <span class="ruby-comment"># File lib/common_functions.rb, line 26</span>
432
- def self.shell(cmd)
433
- return `#{cmd}`
434
- end</pre>
435
- </div>
403
+ <div class="method-source-code" id="shell-source">
404
+ <pre><span class="ruby-comment"># File lib/common_functions.rb, line 26</span>
405
+ <span class="ruby-keyword">def</span> <span class="ruby-keyword">self</span>.<span class="ruby-identifier">shell</span>(<span class="ruby-identifier">cmd</span>)
406
+ <span class="ruby-keyword">return</span> <span class="ruby-node">%x#{cmd}`</span>
407
+ <span class="ruby-keyword">end</span></pre>
408
+ </div><!-- shell-source -->
436
409
 
437
410
  </div>
438
411
 
439
412
 
440
413
 
441
414
 
442
- </div>
415
+ </div><!-- shell-method -->
443
416
 
444
417
 
445
- </div>
418
+ </section><!-- public-class-method-details -->
446
419
 
420
+ </section><!-- 5Buntitled-5D -->
447
421
 
448
- </div>
422
+ </div><!-- documentation -->
449
423
 
450
- <div id="validator-badges">
451
- <p><small><a href="http://validator.w3.org/check/referer">[Validate]</a></small></p>
452
- <p><small>Generated with the <a href="http://deveiate.org/projects/Darkfish-Rdoc/">Darkfish
453
- Rdoc Generator</a> 2</small>.</p>
454
- </div>
455
424
 
456
- </body>
457
- </html>
425
+ <footer id="validator-badges">
426
+ <p><a href="http://validator.w3.org/check/referer">[Validate]</a>
427
+ <p>Generated by <a href="https://github.com/rdoc/rdoc">RDoc</a> 3.12.
428
+ <p>Generated with the <a href="http://deveiate.org/projects/Darkfish-Rdoc/">Darkfish Rdoc Generator</a> 3.
429
+ </footer>
458
430