vmc-ng/lib/vmc/cli.rb in vmc-0.4.0.beta.74 vs vmc-ng/lib/vmc/cli.rb in vmc-0.4.0.beta.75
- old
+ new
@@ -76,21 +76,22 @@
fail "Please log in with 'vmc login'."
else
line c("Please log in with 'vmc login'.", :warning)
line
invoke :login
+ invalidate_client
end
end
return unless v2?
unless client.current_organization
- fail "Please select an organization with 'vmc target -i'."
+ fail "Please select an organization with 'vmc target --ask-org'."
end
unless client.current_space
- fail "Please select a space with 'vmc target -i'."
+ fail "Please select a space with 'vmc target --ask-space'."
end
end
def execute(cmd, argv, global = {})
if input[:help]
@@ -107,10 +108,10 @@
log_error(e)
err e.message
rescue SystemExit
raise
rescue CFoundry::Denied => e
- if !$vmc_asked_auth && e.error_code == 200
+ if !$vmc_asked_auth && [200, 10002].include?(e.error_code)
$vmc_asked_auth = true
line
line c("Not authenticated! Try logging in:", :warning)