Skip to content

Commit 33fb20e

Browse files
fix(gateway): Removed unrecoverable state
When the deis radosgw user was created, but setting the access and secret key failed, the store-gateway was stuck in an unrecoverable state.
1 parent 1cb0655 commit 33fb20e

1 file changed

Lines changed: 8 additions & 6 deletions

File tree

  • store/gateway/bin

store/gateway/bin/boot

Lines changed: 8 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -83,14 +83,16 @@ else
8383
fi
8484

8585
if ! radosgw-admin user info --uid=deis >/dev/null 2>&1 ; then
86-
radosgw-admin user create --uid=deis --display-name="Deis" >/etc/ceph/user.json
87-
# store the access key and secret key for consumption by other services
88-
ACCESS_KEY=`cat /etc/ceph/user.json | python -c 'import json,sys;obj=json.load(sys.stdin);print json.dumps(obj["keys"][0]["access_key"]);' | tr -d '"'`
89-
SECRET_KEY=`cat /etc/ceph/user.json | python -c 'import json,sys;obj=json.load(sys.stdin);print json.dumps(obj["keys"][0]["secret_key"]);' | tr -d '"'`
90-
etcdctl --no-sync -C $ETCD set $ETCD_PATH/accessKey ${ACCESS_KEY} >/dev/null
91-
etcdctl --no-sync -C $ETCD set $ETCD_PATH/secretKey ${SECRET_KEY} >/dev/null
86+
radosgw-admin user create --uid=deis --display-name="Deis"
9287
fi
9388

89+
radosgw-admin user info --uid=deis >/etc/ceph/user.json
90+
# store the access key and secret key for consumption by other services
91+
ACCESS_KEY=`cat /etc/ceph/user.json | python -c 'import json,sys;obj=json.load(sys.stdin);print json.dumps(obj["keys"][0]["access_key"]);' | tr -d '"'`
92+
SECRET_KEY=`cat /etc/ceph/user.json | python -c 'import json,sys;obj=json.load(sys.stdin);print json.dumps(obj["keys"][0]["secret_key"]);' | tr -d '"'`
93+
etcdctl --no-sync -C $ETCD set $ETCD_PATH/accessKey ${ACCESS_KEY} >/dev/null
94+
etcdctl --no-sync -C $ETCD set $ETCD_PATH/secretKey ${SECRET_KEY} >/dev/null
95+
9496
# spawn the service in the background
9597
echo "Starting RADOS gateway..."
9698
/etc/init.d/radosgw start

0 commit comments

Comments
 (0)