10gen / mongo-orchestration

Apache License 2.0
7 stars 11 forks source link

UnboundLocalError for 'shard_configs' when specifying a keyfile with a sharded cluster. #187

Closed estolfo closed 9 years ago

estolfo commented 9 years ago

$ mongo-orchestration --version Mongo Orchestration v0.2

In creating a sharded cluster with an 'auth_key' specified, I'm getting a UnboundLocalError for 'shard_configs'.

Here are the steps I'm taking using Ruby to get this error: https://gist.github.com/estolfo/8e70bc5ca45159ac0cda

And here is the traceback:

Traceback (most recent call last): File \"/Library/Python/2.7/site-packages/mongo_orchestration/apps/init.py line 62, in wrap\n return f(_arg, *_kwd) File \"/Library/Python/2.7/site-packages/mongo_orchestration/apps/sharded_clusters.py\", line 67, in sh_create\n result = _sh_create(data) File \"/Library/Python/2.7/site-packages/mongo_orchestration/apps/sharded_clusters.py line 43, in _sh_create\n cluster_id = ShardedClusters().create(params) File \"/Library/Python/2.7/site-packages/mongo_orchestration/sharded_clusters.py line 408, in create\n cluster = ShardedCluster(params) File \"/Library/Python/2.7/site-packages/mongo_orchestration/sharded_clusters.py line 130, in init\n for cfg in shard_configs: UnboundLocalError: local variable 'shard_configs' referenced before assignment

llvtt commented 9 years ago

fixed in 3910c988259137d779170eb9c086bf8d417b4ffe. Just to note, auth_key is supposed to be the contents of the key file, not the path to the key file (and "~" is not a valid character in a key file).

estolfo commented 9 years ago

ah, got it. Thanks