lib/boot.rb in forj-0.0.24 vs lib/boot.rb in forj-0.0.25
- old
+ new
@@ -13,10 +13,11 @@
# distributed under the License is distributed on an "AS IS" BASIS,
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
# See the License for the specific language governing permissions and
# limitations under the License.
+require 'rubygems'
require 'require_relative'
require_relative 'network.rb'
include Network
require_relative 'yaml_parse.rb'
@@ -34,21 +35,23 @@
# Boot module
#
module Boot
def boot(blueprint, cloud_provider, name, build_config_dir, branch, test = false)
begin
- initial_msg = format('booting %{blueprint} on %{cloud_provider}',
- blueprint: blueprint , cloud_provider: cloud_provider)
+ initial_msg = 'booting %s on %s' % [blueprint , cloud_provider]
+
Logging.info(initial_msg)
puts (initial_msg)
forj_dir = File.expand_path(File.dirname(__FILE__))
Dir.chdir(forj_dir)
- definitions = YamlParse.get_values('../lib/catalog.yaml')
+ definitions = YamlParse.get_values('catalog.yaml')
- Repositories.clone_repo
+ maestro_url = definitions['default']['maestro']
+ Repositories.clone_repo(maestro_url)
+
network = Network.create_network(name)
subnet = Network.create_subnet(network.id, name)
router = Network.get_router(definitions[blueprint]['router'])
Network.create_router_interface(subnet.id, router)
@@ -70,15 +73,15 @@
home = Helpers.get_home_path
build_path = home + '/.forj/maestro/build'
Dir.chdir(build_path)
if build_config_dir
- command = format('bin/build.sh --build_ID maestro.%{name} --box-name maestro --build-conf-dir %{build_config_dir} --build-config box-13.5 --gitBranch %{branch}', name: name, build_config_dir: build_config_dir, branch: branch)
+ command = 'bin/build.sh --build_ID maestro.%s --box-name maestro --build-conf-dir %s --build-config box-13.5 --gitBranch %s' % [name,build_config_dir, branch]
elsif blueprint != 'redstone'
- command = format('bin/build.sh --build_ID %{name} --box-name maestro --build-conf-dir ~/.forj/maestro/build/conf --build-config box --blueprint %{blueprint_name}', name: name, blueprint_name: blueprint)
+ command = 'bin/build.sh --build_ID %s --box-name maestro --build-conf-dir ~/.forj/maestro/build/conf --build-config box --blueprint %s' % [name, blueprint]
else
- command = format('bin/build.sh --build_ID %{name} --box-name maestro --build-conf-dir ~/.forj/maestro/build/conf --build-config box', name: name)
+ command = 'bin/build.sh --build_ID %s --box-name maestro --build-conf-dir ~/.forj/maestro/build/conf --build-config box' % [name]
end
Kernel.system(command)
Dir.chdir(current_dir)
@@ -88,10 +91,10 @@
Network.delete_subnet(subnet.id)
Network.delete_network(network.name)
end
rescue SystemExit, Interrupt
- msg = format('%{name} interrupted by user')
+ msg = '%s interrupted by user' % [name]
puts msg
Logging.info(msg)
rescue StandardError => e
Logging.error(e.message)
end