corl 0.4.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (132) hide show
  1. data/.document +5 -0
  2. data/.gitmodules +4 -0
  3. data/Gemfile +24 -0
  4. data/Gemfile.lock +123 -0
  5. data/LICENSE.txt +674 -0
  6. data/README.rdoc +27 -0
  7. data/Rakefile +78 -0
  8. data/VERSION +1 -0
  9. data/bin/corl +55 -0
  10. data/corl.gemspec +228 -0
  11. data/lib/corl/action/add.rb +69 -0
  12. data/lib/corl/action/bootstrap.rb +83 -0
  13. data/lib/corl/action/clone.rb +40 -0
  14. data/lib/corl/action/create.rb +55 -0
  15. data/lib/corl/action/exec.rb +41 -0
  16. data/lib/corl/action/extract.rb +49 -0
  17. data/lib/corl/action/image.rb +30 -0
  18. data/lib/corl/action/images.rb +55 -0
  19. data/lib/corl/action/lookup.rb +35 -0
  20. data/lib/corl/action/machines.rb +51 -0
  21. data/lib/corl/action/provision.rb +37 -0
  22. data/lib/corl/action/remove.rb +51 -0
  23. data/lib/corl/action/save.rb +53 -0
  24. data/lib/corl/action/seed.rb +115 -0
  25. data/lib/corl/action/spawn.rb +75 -0
  26. data/lib/corl/action/start.rb +37 -0
  27. data/lib/corl/action/stop.rb +30 -0
  28. data/lib/corl/action/update.rb +37 -0
  29. data/lib/corl/command/shell.rb +164 -0
  30. data/lib/corl/configuration/file.rb +386 -0
  31. data/lib/corl/event/puppet.rb +90 -0
  32. data/lib/corl/event/regex.rb +52 -0
  33. data/lib/corl/extension/puppetloader.rb +24 -0
  34. data/lib/corl/machine/fog.rb +310 -0
  35. data/lib/corl/machine/physical.rb +161 -0
  36. data/lib/corl/network/default.rb +26 -0
  37. data/lib/corl/node/aws.rb +90 -0
  38. data/lib/corl/node/fog.rb +198 -0
  39. data/lib/corl/node/google.rb +115 -0
  40. data/lib/corl/node/local.rb +26 -0
  41. data/lib/corl/node/rackspace.rb +89 -0
  42. data/lib/corl/project/git.rb +465 -0
  43. data/lib/corl/project/github.rb +108 -0
  44. data/lib/corl/provisioner/puppetnode/resource.rb +245 -0
  45. data/lib/corl/provisioner/puppetnode/resource_group.rb +205 -0
  46. data/lib/corl/provisioner/puppetnode.rb +407 -0
  47. data/lib/corl/template/environment.rb +73 -0
  48. data/lib/corl/template/json.rb +16 -0
  49. data/lib/corl/template/wrapper.rb +16 -0
  50. data/lib/corl/template/yaml.rb +16 -0
  51. data/lib/corl/translator/json.rb +27 -0
  52. data/lib/corl/translator/yaml.rb +27 -0
  53. data/lib/corl.rb +173 -0
  54. data/lib/corl_core/codes.rb +107 -0
  55. data/lib/corl_core/config/collection.rb +57 -0
  56. data/lib/corl_core/config/options.rb +70 -0
  57. data/lib/corl_core/config.rb +337 -0
  58. data/lib/corl_core/core.rb +59 -0
  59. data/lib/corl_core/corl.rb +254 -0
  60. data/lib/corl_core/errors.rb +84 -0
  61. data/lib/corl_core/facade.rb +126 -0
  62. data/lib/corl_core/gems.rb +72 -0
  63. data/lib/corl_core/manager.rb +425 -0
  64. data/lib/corl_core/mixin/action/commit.rb +58 -0
  65. data/lib/corl_core/mixin/action/keypair.rb +105 -0
  66. data/lib/corl_core/mixin/action/node.rb +129 -0
  67. data/lib/corl_core/mixin/action/project.rb +53 -0
  68. data/lib/corl_core/mixin/action/push.rb +52 -0
  69. data/lib/corl_core/mixin/config/collection.rb +53 -0
  70. data/lib/corl_core/mixin/config/ops.rb +53 -0
  71. data/lib/corl_core/mixin/config/options.rb +39 -0
  72. data/lib/corl_core/mixin/lookup.rb +196 -0
  73. data/lib/corl_core/mixin/macro/object_interface.rb +361 -0
  74. data/lib/corl_core/mixin/macro/plugin_interface.rb +380 -0
  75. data/lib/corl_core/mixin/settings.rb +46 -0
  76. data/lib/corl_core/mixin/sub_config.rb +148 -0
  77. data/lib/corl_core/mod/hash.rb +29 -0
  78. data/lib/corl_core/mod/hiera_backend.rb +63 -0
  79. data/lib/corl_core/plugin/action.rb +381 -0
  80. data/lib/corl_core/plugin/base.rb +374 -0
  81. data/lib/corl_core/plugin/command.rb +98 -0
  82. data/lib/corl_core/plugin/configuration.rb +177 -0
  83. data/lib/corl_core/plugin/event.rb +53 -0
  84. data/lib/corl_core/plugin/extension.rb +12 -0
  85. data/lib/corl_core/plugin/machine.rb +266 -0
  86. data/lib/corl_core/plugin/network.rb +359 -0
  87. data/lib/corl_core/plugin/node.rb +904 -0
  88. data/lib/corl_core/plugin/project.rb +927 -0
  89. data/lib/corl_core/plugin/provisioner.rb +51 -0
  90. data/lib/corl_core/plugin/template.rb +80 -0
  91. data/lib/corl_core/plugin/translator.rb +38 -0
  92. data/lib/corl_core/util/cli.rb +352 -0
  93. data/lib/corl_core/util/data.rb +404 -0
  94. data/lib/corl_core/util/disk.rb +114 -0
  95. data/lib/corl_core/util/git.rb +47 -0
  96. data/lib/corl_core/util/interface.rb +319 -0
  97. data/lib/corl_core/util/liquid.rb +17 -0
  98. data/lib/corl_core/util/package.rb +93 -0
  99. data/lib/corl_core/util/shell.rb +239 -0
  100. data/lib/corl_core/util/ssh.rb +286 -0
  101. data/lib/facter/corl_config_ready.rb +13 -0
  102. data/lib/facter/corl_exists.rb +15 -0
  103. data/lib/facter/corl_network.rb +17 -0
  104. data/lib/hiera/corl_logger.rb +18 -0
  105. data/lib/puppet/indirector/corl.rb +27 -0
  106. data/lib/puppet/indirector/data_binding/corl.rb +6 -0
  107. data/lib/puppet/parser/functions/config_initialized.rb +26 -0
  108. data/lib/puppet/parser/functions/corl_include.rb +44 -0
  109. data/lib/puppet/parser/functions/corl_resources.rb +58 -0
  110. data/lib/puppet/parser/functions/deep_merge.rb +21 -0
  111. data/lib/puppet/parser/functions/ensure.rb +29 -0
  112. data/lib/puppet/parser/functions/file_exists.rb +19 -0
  113. data/lib/puppet/parser/functions/global_array.rb +35 -0
  114. data/lib/puppet/parser/functions/global_hash.rb +35 -0
  115. data/lib/puppet/parser/functions/global_options.rb +23 -0
  116. data/lib/puppet/parser/functions/global_param.rb +43 -0
  117. data/lib/puppet/parser/functions/interpolate.rb +26 -0
  118. data/lib/puppet/parser/functions/is_false.rb +21 -0
  119. data/lib/puppet/parser/functions/is_true.rb +21 -0
  120. data/lib/puppet/parser/functions/module_array.rb +38 -0
  121. data/lib/puppet/parser/functions/module_hash.rb +38 -0
  122. data/lib/puppet/parser/functions/module_options.rb +23 -0
  123. data/lib/puppet/parser/functions/module_param.rb +48 -0
  124. data/lib/puppet/parser/functions/name.rb +21 -0
  125. data/lib/puppet/parser/functions/render.rb +33 -0
  126. data/lib/puppet/parser/functions/value.rb +21 -0
  127. data/locales/en.yml +232 -0
  128. data/spec/corl_core/interface_spec.rb +489 -0
  129. data/spec/corl_mock_input.rb +29 -0
  130. data/spec/corl_test_kernel.rb +22 -0
  131. data/spec/spec_helper.rb +15 -0
  132. metadata +406 -0
@@ -0,0 +1,49 @@
1
+
2
+ module CORL
3
+ module Action
4
+ class Extract < Plugin::Action
5
+
6
+ #-----------------------------------------------------------------------------
7
+ # Action settings
8
+
9
+ def configure
10
+ super do
11
+ codes :extract_failure
12
+
13
+ register :path, :str, nil do |value|
14
+ unless File.directory?(value)
15
+ warn('corl.actions.extract.errors.path', { :value => value })
16
+ next false
17
+ end
18
+ true
19
+ end
20
+ register :encoded, :str, nil do |value|
21
+ @package = Util::Package.new(value)
22
+ if @package.data.export.empty?
23
+ warn('corl.actions.extract.errors.encoded', { :value => value })
24
+ next false
25
+ end
26
+ true
27
+ end
28
+ end
29
+ end
30
+
31
+ #---
32
+
33
+ def arguments
34
+ [ :path, :encoded ]
35
+ end
36
+
37
+ #-----------------------------------------------------------------------------
38
+ # Action operations
39
+
40
+ def execute
41
+ super do |node, network|
42
+ unless @package.extract(settings[:path])
43
+ myself.status = code.extract_failure
44
+ end
45
+ end
46
+ end
47
+ end
48
+ end
49
+ end
@@ -0,0 +1,30 @@
1
+
2
+ module CORL
3
+ module Action
4
+ class Image < Plugin::Action
5
+
6
+ #-----------------------------------------------------------------------------
7
+ # Image action interface
8
+
9
+ def normalize
10
+ super('corl image')
11
+ end
12
+
13
+ #-----------------------------------------------------------------------------
14
+ # Action operations
15
+
16
+ def parse(parser)
17
+ end
18
+
19
+ #---
20
+
21
+ def execute
22
+ super do |node, network, status|
23
+ info('corl.core.actions.image.start')
24
+
25
+ status
26
+ end
27
+ end
28
+ end
29
+ end
30
+ end
@@ -0,0 +1,55 @@
1
+
2
+ module CORL
3
+ module Action
4
+ class Images < Plugin::Action
5
+
6
+ #-----------------------------------------------------------------------------
7
+ # Settings
8
+
9
+ def configure
10
+ super do
11
+ codes :node_load_failure,
12
+ :image_load_failure
13
+
14
+ register :match_case, :bool, false
15
+ register :require_all, :bool, false
16
+ register :search, :array, []
17
+ end
18
+ end
19
+
20
+ #---
21
+
22
+ def ignore
23
+ node_ignore - [ :node_provider ]
24
+ end
25
+
26
+ def arguments
27
+ [ :node_provider, :search ]
28
+ end
29
+
30
+ #-----------------------------------------------------------------------------
31
+ # Operations
32
+
33
+ def execute
34
+ super do |local_node, network|
35
+ info('corl.actions.images.start')
36
+
37
+ if node = network.test_node(settings[:node_provider])
38
+ if images = node.images(settings[:search], settings)
39
+ images.each do |image|
40
+ render(node.render_image(image), { :prefix => false })
41
+ end
42
+
43
+ myself.result = images
44
+ success('corl.actions.images.results', { :images => images.length }) if images.length > 1
45
+ else
46
+ myself.status = code.image_load_failure
47
+ end
48
+ else
49
+ myself.status = code.node_load_failure
50
+ end
51
+ end
52
+ end
53
+ end
54
+ end
55
+ end
@@ -0,0 +1,35 @@
1
+
2
+ module CORL
3
+ module Action
4
+ class Lookup < Plugin::Action
5
+
6
+ #-----------------------------------------------------------------------------
7
+ # Lookup action interface
8
+
9
+ def normalize
10
+ super('corl lookup <property>')
11
+ end
12
+
13
+ #-----------------------------------------------------------------------------
14
+ # Action operations
15
+
16
+ def parse(parser)
17
+ parser.arg_str(:property, nil,
18
+ 'corl.core.actions.create.options.property'
19
+ )
20
+ end
21
+
22
+ #---
23
+
24
+ def execute
25
+ super do |node, network, status|
26
+ property = settings[:property]
27
+ value = lookup(property)
28
+
29
+ ui.success(sprintf("#{property} = %s", value.inspect))
30
+ status
31
+ end
32
+ end
33
+ end
34
+ end
35
+ end
@@ -0,0 +1,51 @@
1
+
2
+ module CORL
3
+ module Action
4
+ class Machines < Plugin::Action
5
+
6
+ #-----------------------------------------------------------------------------
7
+ # Settings
8
+
9
+ def configure
10
+ super do
11
+ codes :node_load_failure,
12
+ :machine_load_failure
13
+ end
14
+ end
15
+
16
+ #---
17
+
18
+ def ignore
19
+ node_ignore - [ :node_provider ]
20
+ end
21
+
22
+ def arguments
23
+ [ :node_provider ]
24
+ end
25
+
26
+ #-----------------------------------------------------------------------------
27
+ # Operations
28
+
29
+ def execute
30
+ super do |local_node, network|
31
+ info('corl.actions.machines.start')
32
+
33
+ if node = network.test_node(settings[:node_provider])
34
+ if machine_types = node.machine_types
35
+ machine_types.each do |machine_type|
36
+ render(node.render_machine_type(machine_type), { :prefix => false })
37
+ end
38
+
39
+ myself.result = machine_types
40
+ success('corl.actions.machines.results', { :machines => machine_types.length }) if machine_types.length > 1
41
+ else
42
+ myself.status = code.machine_load_failure
43
+ end
44
+ else
45
+ myself.status = code.node_load_failure
46
+ end
47
+ end
48
+ end
49
+ end
50
+ end
51
+ end
@@ -0,0 +1,37 @@
1
+
2
+ module CORL
3
+ module Action
4
+ class Provision < Plugin::Action
5
+
6
+ #-----------------------------------------------------------------------------
7
+ # Provision action interface
8
+
9
+ def normalize
10
+ super('corl provision [ <project_directory> ]')
11
+ end
12
+
13
+ #-----------------------------------------------------------------------------
14
+ # Action operations
15
+
16
+ def parse(parser)
17
+ parser.option_str(:provider, nil,
18
+ '--provider PROVISIONER_PROVIDER',
19
+ 'corl.core.actions.provision.options.provider'
20
+ )
21
+ parser.arg_str(:directory, :default,
22
+ 'corl.core.actions.provision.options.directory'
23
+ )
24
+ end
25
+
26
+ #---
27
+
28
+ def execute
29
+ super do |node, network, status|
30
+ info('corl.core.actions.provision.start')
31
+
32
+ status
33
+ end
34
+ end
35
+ end
36
+ end
37
+ end
@@ -0,0 +1,51 @@
1
+
2
+ module CORL
3
+ module Action
4
+ class Remove < Plugin::Action
5
+
6
+ include Mixin::Action::Project
7
+ include Mixin::Action::Push
8
+
9
+ #-----------------------------------------------------------------------------
10
+ # Remove action interface
11
+
12
+ def normalize
13
+ super('corl remove <subproject/path>')
14
+
15
+ codes :project_failure => 20,
16
+ :delete_failure => 21,
17
+ :push_failure => 22
18
+ end
19
+
20
+ #-----------------------------------------------------------------------------
21
+ # Action operations
22
+
23
+ def parse(parser)
24
+ parser.arg_str(:sub_path, nil,
25
+ 'corl.core.actions.remove.options.sub_path'
26
+ )
27
+ project_options(parser, true, true)
28
+ push_options(parser, true)
29
+ end
30
+
31
+ #---
32
+
33
+ def execute
34
+ super do |node, network, status|
35
+ info('corl.core.actions.remove.start')
36
+
37
+ if project = project_load(Dir.pwd, false)
38
+ if project.delete_subproject(settings[:sub_path])
39
+ status = code.push_failure unless push(project)
40
+ else
41
+ status = code.delete_failure
42
+ end
43
+ else
44
+ status = code.project_failure
45
+ end
46
+ status
47
+ end
48
+ end
49
+ end
50
+ end
51
+ end
@@ -0,0 +1,53 @@
1
+
2
+ module CORL
3
+ module Action
4
+ class Save < Plugin::Action
5
+
6
+ include Mixin::Action::Project
7
+ include Mixin::Action::Commit
8
+ include Mixin::Action::Push
9
+
10
+ #-----------------------------------------------------------------------------
11
+ # Save action interface
12
+
13
+ def normalize
14
+ super('corl save [ <file> ... ]')
15
+
16
+ codes :project_failure => 20,
17
+ :commit_failure => 21,
18
+ :push_failure => 22
19
+ end
20
+
21
+ #-----------------------------------------------------------------------------
22
+ # Action operations
23
+
24
+ def parse(parser)
25
+ parser.arg_array(:files, '.',
26
+ 'corl.core.actions.save.options.files'
27
+ )
28
+ project_options(parser, true, false)
29
+ commit_options(parser, false)
30
+ push_options(parser, true)
31
+ end
32
+
33
+ #---
34
+
35
+ def execute
36
+ super do |node, network, status|
37
+ info('corl.core.actions.save.start')
38
+
39
+ if project = project_load(Dir.pwd, false)
40
+ if commit(project, settings[:files])
41
+ status = code.push_failure unless push(project)
42
+ else
43
+ status = code.commit_failure
44
+ end
45
+ else
46
+ status = code.project_failure
47
+ end
48
+ status
49
+ end
50
+ end
51
+ end
52
+ end
53
+ end
@@ -0,0 +1,115 @@
1
+
2
+ module CORL
3
+ module Action
4
+ class Seed < Plugin::Action
5
+
6
+ #-----------------------------------------------------------------------------
7
+ # Settings
8
+
9
+ def configure
10
+ super do
11
+ codes :key_store_failure,
12
+ :project_failure,
13
+ :network_init_failure,
14
+ :network_load_failure,
15
+ :node_load_failure,
16
+ :node_save_failure
17
+ #---
18
+
19
+ register :project_branch, :str, 'master'
20
+ register :project_reference, :str, nil do |value|
21
+ value = value.to_sym
22
+ project_plugins = Manager.connection.loaded_plugins(:project)
23
+
24
+ if @project_info = Plugin::Project.translate_reference(value, true)
25
+ provider = @project_info[:provider]
26
+ else
27
+ provider = value
28
+ end
29
+
30
+ unless project_plugins.keys.include?(provider.to_sym)
31
+ warn('corl.actions.seed.errors.project_reference', { :value => value, :provider => provider, :choices => project_plugins.keys.join(', ') })
32
+ next false
33
+ end
34
+ true
35
+ end
36
+ end
37
+ end
38
+
39
+ #---
40
+
41
+ def arguments
42
+ [ :project_reference ]
43
+ end
44
+
45
+ #-----------------------------------------------------------------------------
46
+ # Operations
47
+
48
+ def execute
49
+ super do |node, network|
50
+ info('corl.actions.seed.start')
51
+
52
+ if node && network
53
+ admin_exec do
54
+ network_path = lookup(:corl_network)
55
+ backup_path = File.join(Dir.tmpdir(), 'corl')
56
+
57
+ render("Generating network SSH deploy keys")
58
+
59
+ if keys = Util::SSH.generate.store
60
+ if @project_info
61
+ project_info = Config.new(@project_info)
62
+ else
63
+ project_info = Config.new({ :provider => :git })
64
+ end
65
+
66
+ render("Backing up current network configuration")
67
+ FileUtils.rm_rf(backup_path)
68
+ FileUtils.mv(network_path, backup_path)
69
+
70
+ render("Seeding network configuration from #{settings[:project_reference]}")
71
+ project = CORL.project(extended_config(:project, {
72
+ :directory => network_path,
73
+ :reference => project_info.get(:reference, nil),
74
+ :url => project_info.get(:url, settings[:project_reference]),
75
+ :revision => project_info.get(:revision, settings[:project_branch]),
76
+ :create => true,
77
+ :pull => true,
78
+ :keys => keys
79
+ }), project_info[:provider])
80
+
81
+ if project
82
+ render("Finalizing network path and removing temporary backup")
83
+ FileUtils.chmod_R(0600, network_path)
84
+ FileUtils.rm_rf(backup_path)
85
+
86
+ render("Reinitializing network")
87
+ if network = init_network
88
+ if network.load
89
+ if node = network.local_node
90
+ render("Updating node network configurations")
91
+ myself.status = code.node_save_failure unless node.save
92
+ else
93
+ myself.status = code.node_load_failure
94
+ end
95
+ else
96
+ myself.status = code.network_load_failure
97
+ end
98
+ else
99
+ myself.status = code.network_init_failure
100
+ end
101
+ else
102
+ myself.status = code.project_failure
103
+ end
104
+ else
105
+ myself.status = code.key_store_failure
106
+ end
107
+ end
108
+ else
109
+ myself.status = code.network_load_failure
110
+ end
111
+ end
112
+ end
113
+ end
114
+ end
115
+ end
@@ -0,0 +1,75 @@
1
+
2
+ module CORL
3
+ module Action
4
+ class Spawn < Plugin::Action
5
+
6
+ include Mixin::Action::Keypair
7
+
8
+ #----------------------------------------------------------------------------
9
+ # Settings
10
+
11
+ def configure
12
+ super do
13
+ codes :network_failure,
14
+ :key_failure,
15
+ :node_create_failure
16
+
17
+ register :region, :str, nil
18
+ register :machine_type, :str, nil
19
+ register :image, :str, nil
20
+ register :hostnames, :array, nil
21
+
22
+ keypair_config
23
+
24
+ bootstrap = CORL.action_config(:bootstrap)
25
+ config.defaults(bootstrap.config) if bootstrap
26
+
27
+ if seed = CORL.action_config(:seed)
28
+ seed.config[:project_reference].default = "github:::coraltech/cluster-test[master]"
29
+ config.defaults(seed.config)
30
+ end
31
+ end
32
+ end
33
+
34
+ #---
35
+
36
+ def ignore
37
+ node_ignore - [ :parallel, :node_provider ] + [ :bootstrap_nodes ]
38
+ end
39
+
40
+ def arguments
41
+ [ :node_provider, :image, :hostnames ]
42
+ end
43
+
44
+ #-----------------------------------------------------------------------------
45
+ # Operations
46
+
47
+ def execute
48
+ super do |node, network|
49
+ info('corl.core.actions.spawn.start')
50
+
51
+ if network
52
+ if keypair && keypair_clean
53
+ results = []
54
+ node_provider = settings.delete(:node_provider)
55
+
56
+ settings.delete(:hostnames).each do |hostname|
57
+ if settings[:parallel]
58
+ results << network.future.add_node(node_provider, hostname, settings)
59
+ else
60
+ results << network.add_node(node_provider, hostname, settings)
61
+ end
62
+ end
63
+ results = results.map { |future| future.value } if settings[:parallel]
64
+ myself.status = code.batch_error if results.include?(false)
65
+ else
66
+ myself.status = code.key_failure
67
+ end
68
+ else
69
+ myself.status = code.network_failure
70
+ end
71
+ end
72
+ end
73
+ end
74
+ end
75
+ end
@@ -0,0 +1,37 @@
1
+
2
+ module CORL
3
+ module Action
4
+ class Start < Plugin::Action
5
+
6
+ #-----------------------------------------------------------------------------
7
+ # Start action interface
8
+
9
+ def normalize
10
+ super('corl start <node_reference>')
11
+ end
12
+
13
+ #-----------------------------------------------------------------------------
14
+ # Action operations
15
+
16
+ def parse(parser)
17
+ parser.option_str(:provider, :rackspace,
18
+ '--provider DEFAULT_NODE_PROVIDER',
19
+ 'corl.core.actions.start.options.provider'
20
+ )
21
+ parser.arg_str(:node_reference, nil,
22
+ 'corl.core.actions.start.options.node_reference'
23
+ )
24
+ end
25
+
26
+ #---
27
+
28
+ def execute
29
+ super do |node, network, status|
30
+ info('corl.core.actions.start.start')
31
+
32
+ status
33
+ end
34
+ end
35
+ end
36
+ end
37
+ end
@@ -0,0 +1,30 @@
1
+
2
+ module CORL
3
+ module Action
4
+ class Stop < Plugin::Action
5
+
6
+ #-----------------------------------------------------------------------------
7
+ # Stop action interface
8
+
9
+ def normalize
10
+ super('corl stop')
11
+ end
12
+
13
+ #-----------------------------------------------------------------------------
14
+ # Action operations
15
+
16
+ def parse(parser)
17
+ end
18
+
19
+ #---
20
+
21
+ def execute
22
+ super do |node, network, status|
23
+ info('corl.core.actions.stop.start')
24
+
25
+ status
26
+ end
27
+ end
28
+ end
29
+ end
30
+ end
@@ -0,0 +1,37 @@
1
+
2
+ module CORL
3
+ module Action
4
+ class Update < Plugin::Action
5
+
6
+ include Mixin::Action::Project
7
+
8
+ #-----------------------------------------------------------------------------
9
+ # Update action interface
10
+
11
+ def normalize
12
+ super('corl update')
13
+
14
+ codes :project_failure => 20
15
+ end
16
+
17
+ #-----------------------------------------------------------------------------
18
+ # Action operations
19
+
20
+ def parse(parser)
21
+ project_options(parser, true, true)
22
+ end
23
+
24
+ #---
25
+
26
+ def execute
27
+ super do |node, network, status|
28
+ info('corl.core.actions.update.start')
29
+
30
+ project = project_load(Dir.pwd, true)
31
+ status = code.project_failure unless project
32
+ status
33
+ end
34
+ end
35
+ end
36
+ end
37
+ end