10gen / mongo-orchestration

Apache License 2.0
7 stars 11 forks source link

Adding mongo_orchestration unnecessarily to the path #117

Closed TylerBrock closed 10 years ago

TylerBrock commented 10 years ago

I run the following and it seems like an extra mongo_orchestration is being added to the path.

It's looking here: /home/tbrock/Code/mongo-orchestration/mongo_orchestration/configurations/replica_sets/arbiter.json

However it would find it here: /home/tbrock/Code/mongo-orchestration/configurations/replica_sets/arbiter.json

$ sudo pip install git+git://github.com/mongodb/mongo-orchestration@master
$ sudo pip install httpie
$ sudo mongo-orchestration start
$ http --json POST localhost:8889/replica_sets preset="arbiter.json"
HTTP/1.1 500 Internal Server Error
Content-Length: 822
Content-Type: application/json
Date: Tue, 14 Oct 2014 21:38:20 GMT
Server: bigbrock

[
    "Traceback (most recent call last):\n",
    "  File \"/home/tbrock/.virtualenvs/mongo/lib/python2.7/site-packages/pymongo_orchestration-0.1-py2.7.egg/mongo_orchestration/apps/__init__.py\", line 62, in wrap\n    return f(*arg, **kwd)\n",
    "  File \"/home/tbrock/.virtualenvs/mongo/lib/python2.7/site-packages/pymongo_orchestration-0.1-py2.7.egg/mongo_orchestration/apps/replica_sets.py\", line 52, in rs_create\n    data = preset_merge(data, 'replica_sets')\n",
    "  File \"/home/tbrock/.virtualenvs/mongo/lib/python2.7/site-packages/pymongo_orchestration-0.1-py2.7.egg/mongo_orchestration/common.py\", line 39, in preset_merge\n    with open(path, \"r\") as preset_file:\n",
    "IOError: [Errno 2] No such file or directory: u'/home/tbrock/Code/mongo-orchestration/mongo_orchestration/configurations/replica_sets/arbiter.json'\n"
]
llvtt commented 10 years ago

mongo-orchestration is the name of the repository. mongo_orchestration is the name of the top-level Python package.

I think the problem is that we're looking for presets in the "configurations" directory relative to the package, which didn't exist until recently. We can make this relative to the current working directory instead.

Workaround: set MONGO_ORCHESTRATION_HOME to the location of the "configurations" directory.

TylerBrock commented 10 years ago

Ok great, thanks Luke.

TylerBrock commented 10 years ago

Thanks for patching that up Luke. However, I don't believe that alone will fix this particular problem because it appears we don't install the configurations when the package gets installed.

/usr/local/lib/python2.7/distpackages/mongo_orchestration has no configurations directory and sudo find . -name "arbiter\.json" returns nothing.

I created an issue to track that #121

llvtt commented 10 years ago

resolved in 70859460bffc929fcc11895de2cb9bb96ea4bd95