Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Passing --project-index to show_story gives list index out of range #4

Open
wkoot opened this issue Sep 12, 2013 · 2 comments
Open

Comments

@wkoot
Copy link

wkoot commented Sep 12, 2013

When I pass --project-index to show_story, I get error displayed below.
Without specifying this option, it works as expected.

I've installed to a virtualenv, with pip install.
Running on Ubuntu 12.10 (server), Python 2.7.3

$ pivotal_tools show_story 12345678 --project-index=12345
Traceback (most recent call last):
  File "~/bin/pivotal_tools", line 8, in <module>
    load_entry_point('pivotal-tools==0.13', 'console_scripts', 'pivotal_tools')()
  File "~/local/lib/python2.7/site-packages/pivotal_tools/cli.py", line 487, in main
    show_story(arguments['<story_id>'], arguments)
  File "~/local/lib/python2.7/site-packages/pivotal_tools/cli.py", line 172, in show_story
    story = load_story(story_id, arguments)
  File "~/local/lib/python2.7/site-packages/pivotal_tools/cli.py", line 245, in load_story
    story = Story.find(story_id, project_index=idx)
  File "~/local/lib/python2.7/site-packages/pivotal_tools/pivotal.py", line 78, in find
    project = Project.all()[project_index]
IndexError: list index out of range
@jtushman
Copy link
Owner

Hi @wkoot,

So project-index != project-id. I should have been more explict in my docs. And handle the index error.

But if you do a:

pivotal_tools show_stories

if you have have multiple projects it will list them like so:

  1. first project
  2. second project

^---- that number is the number I am using for index

Also -- for show story you do not have to pass the project-index. It will find the story for you

@wkoot
Copy link
Author

wkoot commented Sep 12, 2013

I'm only linked to one project, but the docs suggest passing the project_index since it'd be quicker :-)
Also, pivotal_tools show_stories --project-index=12345 works just fine for me?

Indeed if I use --project-index=1 with show_story, it returns without problems.
How would I know the project index number when I have multiple projects though?
Is it based on Pivotal's project-id (eg. lowest project-id has index 1, and so on)?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants