mirror of
https://github.com/aptly-dev/aptly.git
synced 2026-07-25 13:37:51 +00:00
Merge branch 'sbadia-swift' of github.com:sbadia/aptly into sbadia-swift
This commit is contained in:
@@ -1,6 +1,6 @@
|
|||||||
export OS_AUTH_URL=http://127.0.0.1:8181/v2.0/
|
export ST_AUTH=http://127.0.0.1:8181/auth/v1.0
|
||||||
export OS_USERNAME=user_test
|
export ST_USER=test:tester
|
||||||
export OS_PASSWORD=tester
|
ID=`docker run -d -p 8080:8080 serverascode/swift-onlyone`
|
||||||
export OS_TENANT_NAME=testing
|
sleep 10 # Give the script that change the passwords some time
|
||||||
|
export ST_KEY=`docker logs $ID | grep "user_test_tester =" | cut -d " " -f 3`
|
||||||
pip install python-keystoneclient python-swiftclient
|
pip install python-keystoneclient python-swiftclient
|
||||||
docker run -d -p 8080:8080 serverascode/swift-onlyone
|
|
||||||
+9
-3
@@ -31,13 +31,19 @@ var (
|
|||||||
// keys, tenant and tenantId
|
// keys, tenant and tenantId
|
||||||
func NewPublishedStorage(username string, password string, authUrl string, tenant string, tenantId string, container string, prefix string) (*PublishedStorage, error) {
|
func NewPublishedStorage(username string, password string, authUrl string, tenant string, tenantId string, container string, prefix string) (*PublishedStorage, error) {
|
||||||
if username == "" {
|
if username == "" {
|
||||||
username = os.Getenv("OS_USERNAME")
|
if username = os.Getenv("OS_USERNAME"); username == "" {
|
||||||
|
username = os.Getenv("ST_USER")
|
||||||
|
}
|
||||||
}
|
}
|
||||||
if password == "" {
|
if password == "" {
|
||||||
password = os.Getenv("OS_PASSWORD")
|
if password = os.Getenv("OS_PASSWORD"); password == "" {
|
||||||
|
password = os.Getenv("ST_KEY")
|
||||||
|
}
|
||||||
}
|
}
|
||||||
if authUrl == "" {
|
if authUrl == "" {
|
||||||
authUrl = os.Getenv("OS_AUTH_URL")
|
if authUrl = os.Getenv("OS_AUTH_URL"); authUrl == "" {
|
||||||
|
authUrl = os.Getenv("ST_AUTH")
|
||||||
|
}
|
||||||
}
|
}
|
||||||
if tenant == "" {
|
if tenant == "" {
|
||||||
tenant = os.Getenv("OS_TENANT_NAME")
|
tenant = os.Getenv("OS_TENANT_NAME")
|
||||||
|
|||||||
@@ -15,6 +15,13 @@ try:
|
|||||||
account_username = "%s:%s" % (auth_tenant, auth_username)
|
account_username = "%s:%s" % (auth_tenant, auth_username)
|
||||||
swift_conn = swiftclient.Connection(auth_url, account_username,
|
swift_conn = swiftclient.Connection(auth_url, account_username,
|
||||||
auth_password, auth_version=2)
|
auth_password, auth_version=2)
|
||||||
|
elif 'ST_USER' in os.environ and 'ST_KEY' in os.environ:
|
||||||
|
auth_username = os.environ.get('ST_USER')
|
||||||
|
auth_password = os.environ.get('ST_KEY')
|
||||||
|
auth_url = os.environ.get('ST_AUTH')
|
||||||
|
# Using auth version 1 (/auth/v1.0)
|
||||||
|
swift_conn = swiftclient.Connection(auth_url, auth_username,
|
||||||
|
auth_password, auth_version=1)
|
||||||
else:
|
else:
|
||||||
swift_conn = None
|
swift_conn = None
|
||||||
except ImportError:
|
except ImportError:
|
||||||
|
|||||||
Reference in New Issue
Block a user