Skip to content
This repository has been archived by the owner on Jan 25, 2022. It is now read-only.

cf crashes when there are no organizations defined #50

Closed
michaelklishin opened this issue Aug 23, 2013 · 0 comments
Closed

cf crashes when there are no organizations defined #50

michaelklishin opened this issue Aug 23, 2013 · 0 comments

Comments

@michaelklishin
Copy link

CF::Populators::Space#choices assumes there an organization to list spaces on

      def choices
        organization.spaces(:depth => 0)
      end

At least in the case of a locally running CCNG instance, that may not be the case, so cf login crashes with

./bin/cf.dev login michael
target: http://127.0.0.1:8181

Password> **********

Authenticating... OK
There are no organizations. You may want to create one with create-org.... OK
Time of crash:
  2013-08-23 15:26:43 +0400

NoMethodError: undefined method `spaces' for nil:NilClass

cf.git/lib/cf/cli/populators/space.rb:25:in `choices'
cf.git/lib/cf/cli/populators/populator_methods.rb:48:in `prompt_user'
cf.git/lib/cf/cli/populators/populator_methods.rb:38:in `get_object'
cf.git/lib/cf/cli/populators/populator_methods.rb:13:in `populate_and_save!'
cf.git/lib/cf/cli/populators/target.rb:9:in `populate_and_save!'
cf.git/lib/cf/cli/start/login.rb:80:in `login'
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants