diff --git a/lib/mrsk/cli/registry.rb b/lib/mrsk/cli/registry.rb index 716e5f5e..958f1497 100644 --- a/lib/mrsk/cli/registry.rb +++ b/lib/mrsk/cli/registry.rb @@ -5,10 +5,14 @@ class Mrsk::Cli::Registry < Mrsk::Cli::Base def login run_locally { execute *MRSK.registry.login } on(MRSK.config.hosts) { execute *MRSK.registry.login } + rescue ArgumentError => e + puts e.message end desc "logout", "Logout of the registry remotely" def logout on(MRSK.config.hosts) { execute *MRSK.registry.logout } + rescue ArgumentError => e + puts e.message end end diff --git a/lib/mrsk/configuration.rb b/lib/mrsk/configuration.rb index 8c19808a..5f920d97 100644 --- a/lib/mrsk/configuration.rb +++ b/lib/mrsk/configuration.rb @@ -105,9 +105,13 @@ class Mrsk::Configuration raise ArgumentError, "Missing required configuration for #{key}" unless config[key].present? end - %w[ username password ].each do |key| - raise ArgumentError, "Missing required configuration for registry/#{key}" unless config.registry[key].present? + if config.registry["username"].blank? + raise ArgumentError, "You must specify a username for the registry in config/deploy.yml" end + + if config.registry["password"].blank? + raise ArgumentError, "You must specify a password for the registry in config/deploy.yml (or set the ENV variable if that's used)" + end end def role_names