Skip to content

Commit 7139ad5

Browse files
committed
Merge pull request #2436 from johanneswuerbach/gateway-race
fix(gateway): Removed unrecoverable state
2 parents 686e809 + 33fb20e commit 7139ad5

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)