Permalink
Browse files

@config.data => @config.definition

  • Loading branch information...
1 parent b6f86be commit f7a74bb7ffe8d6db8900689bffacb897941a5783 @goldmann goldmann committed Nov 24, 2009
Showing with 9 additions and 9 deletions.
  1. +3 −3 lib/cantiere/config.rb
  2. +3 −3 lib/cantiere/gpg-sign.rb
  3. +1 −1 lib/cantiere/helpers/config-helper.rb
  4. +2 −2 lib/cantiere/ssh/ssh-config.rb
@@ -75,10 +75,10 @@ def initialize( project_config = Hash.new )
end
if File.exists?( CONFIG_FILE )
- @data = YAML.load_file( CONFIG_FILE )
- raise "Your config file (#{CONFIG_FILE}) has incorrect format. Please correct it." if @data.nil?
+ @definition = YAML.load_file( CONFIG_FILE )
+ raise "Your config file (#{CONFIG_FILE}) has incorrect format. Please correct it." if @definition.nil?
else
- @data = {}
+ @definition = {}
end
@build_arch = ENV['CANTIERE_ARCH'].nil? ? @arch : ENV['CANTIERE_ARCH']
@@ -46,18 +46,18 @@ def define_tasks
end
def sign_srpms
- validate_and_sign( "#{@config.dir.base}/extras/sign-rpms #{@config.data['gpg_password']} #{@config.dir.top}/#{APPLIANCE_DEFAULTS['os_name']}/#{APPLIANCE_DEFAULTS['os_version']}/SRPMS/*.src.rpm > /dev/null 2>&1", "SRPMs" )
+ validate_and_sign( "#{@config.dir.base}/extras/sign-rpms #{@config.definition['gpg_password']} #{@config.dir.top}/#{APPLIANCE_DEFAULTS['os_name']}/#{APPLIANCE_DEFAULTS['os_version']}/SRPMS/*.src.rpm > /dev/null 2>&1", "SRPMs" )
end
def sing_rpms
- validate_and_sign( "#{@config.dir.base}/extras/sign-rpms #{@config.data['gpg_password']} #{@config.dir.top}/#{@config.os_path}/RPMS/*/*.rpm > /dev/null 2>&1", "RPMs" )
+ validate_and_sign( "#{@config.dir.base}/extras/sign-rpms #{@config.definition['gpg_password']} #{@config.dir.top}/#{@config.os_path}/RPMS/*/*.rpm > /dev/null 2>&1", "RPMs" )
end
def validate_and_sign( command, type )
@log.info "Signing #{type}..."
begin
- raise ValidationError, "You have no GPG password specified in Cantiere config file (#{CONFIG_FILE})." if @config.data['gpg_password'].nil?
+ raise ValidationError, "You have no GPG password specified in Cantiere config file (#{CONFIG_FILE})." if @config.definition['gpg_password'].nil?
#@config.helper.validate_gpg_password
@exec_helper.execute( command )
rescue => e
@@ -29,7 +29,7 @@ def initialize( config )
# TODO this is not good, remove this
def validate_gpg_password
- raise ValidationError, "You have no GPG password specified in JBoss Cloud config file." if @config.data['gpg_password'].nil?
+ raise ValidationError, "You have no GPG password specified in JBoss Cloud config file." if @config.definition['gpg_password'].nil?
end
end
@@ -37,10 +37,10 @@ def initialize( config )
def validate
raise ValidationError, "Specified configuration file (#{CONFIG_FILE}) doesn't exists. #{DEFAULT_HELP_TEXT[:general]}" unless File.exists?( CONFIG_FILE )
- raise ValidationError, "No 'ssh' section in config file in configuration file '#{CONFIG_FILE}'. #{DEFAULT_HELP_TEXT[:general]}" if @config.data['ssh'].nil?
+ raise ValidationError, "No 'ssh' section in config file in configuration file '#{CONFIG_FILE}'. #{DEFAULT_HELP_TEXT[:general]}" if @config.definition['ssh'].nil?
# we need only ssh section
- @cfg = @config.data['ssh']
+ @cfg = @config.definition['ssh']
raise ValidationError, "Host not specified in configuration file '#{CONFIG_FILE}' in ssh section. #{DEFAULT_HELP_TEXT[:general]}" if @cfg['host'].nil?
raise ValidationError, "Username not specified in configuration file '#{CONFIG_FILE}' in ssh section. #{DEFAULT_HELP_TEXT[:general]}" if @cfg['username'].nil?

0 comments on commit f7a74bb

Please sign in to comment.