Ask Your Question

eugene.goldberg's profile - activity

2019-04-28 04:38:39 -0500 received badge  Famous Question (source)
2019-04-28 04:38:39 -0500 received badge  Notable Question (source)
2019-04-28 04:38:39 -0500 received badge  Popular Question (source)
2015-08-14 16:31:54 -0500 received badge  Famous Question (source)
2015-06-16 04:35:34 -0500 received badge  Popular Question (source)
2015-06-16 04:35:34 -0500 received badge  Famous Question (source)
2015-06-16 04:35:34 -0500 received badge  Notable Question (source)
2015-05-18 03:58:02 -0500 received badge  Famous Question (source)
2015-05-14 17:48:13 -0500 received badge  Famous Question (source)
2015-05-14 17:48:13 -0500 received badge  Notable Question (source)
2015-05-11 07:46:00 -0500 received badge  Famous Question (source)
2015-05-11 05:18:55 -0500 received badge  Famous Question (source)
2015-03-20 15:22:59 -0500 received badge  Notable Question (source)
2015-03-20 15:22:59 -0500 received badge  Popular Question (source)
2015-03-17 03:43:18 -0500 received badge  Notable Question (source)
2015-03-17 03:43:13 -0500 received badge  Notable Question (source)
2015-02-25 01:07:15 -0500 received badge  Self-Learner (source)
2015-02-25 01:07:15 -0500 received badge  Teacher (source)
2015-02-25 01:06:15 -0500 received badge  Popular Question (source)
2015-02-24 16:49:26 -0500 received badge  Popular Question (source)
2015-02-24 02:56:26 -0500 received badge  Notable Question (source)
2015-02-20 07:29:28 -0500 received badge  Popular Question (source)
2015-02-19 20:20:48 -0500 asked a question how to backup cinder volumes to a remote swift store

I have two OpenStack servers:

the first one with IP 10.0.0.32 is running cinder, glance, nova, and neutron

the second one with IP 10.0.0.20 is only running swift and keystone

I'm trying to backup a cinder volume located on 10.0.0.32 to a swift store located on 10.0.0.20:

cinder --debug --os-username=admin --os-password=mast3r --os-tenant-name=admin --os-auth-url=http://10.0.0.20:5000/v2.0/ backup-create --container myfiles --display-name backup_vol-02 vol-02
DEBUG:keystoneclient.session:REQ: curl -i -X GET http://10.0.0.20:5000/v2.0/ -H "Accept: application/json" -H "User-Agent: python-keystoneclient"
DEBUG:keystoneclient.session:RESP: [200] {'date': 'Fri, 20 Feb 2015 02:07:41 GMT', 'content-type': 'application/json', 'content-length': '612', 'vary': 'X-Auth-Token'} 
RESP BODY: {"version": {"status": "stable", "updated": "2014-04-17T00:00:00Z", "media-types": [{"base": "application/json", "type": "application/vnd.openstack.identity-v2.0+json"}, {"base": "application/xml", "type": "application/vnd.openstack.identity-v2.0+xml"}], "id": "v2.0", "links": [{"href": "http://10.0.0.20:5000/v2.0/", "rel": "self"}, {"href": "http://docs.openstack.org/api/openstack-identity-service/2.0/content/", "type": "text/html", "rel": "describedby"}, {"href": "http://docs.openstack.org/api/openstack-identity-service/2.0/identity-dev-guide-2.0.pdf", "type": "application/pdf", "rel": "describedby"}]}}

DEBUG:keystoneclient.auth.identity.v2:Making authentication request to http://10.0.0.20:5000/v2.0/tokens
ERROR: publicURL endpoint for volume service not found

As you can tell, I'm not getting very far.

On the swift host (10.0.0.20) I have confirmed having a functional swift install: I'm able to upload and download files like this:

swift -V 2.0 -A http://127.0.0.1:5000/v2.0 -U admin -K mast3r upload myfiles ps.txt

Here are my config files from the swift host (10.0.0.20):

proxy-server.conf:

[DEFAULT]
bind_port = 8080
user = swift

[pipeline:main]
pipeline = healthcheck cache authtoken keystoneauth proxy-server

[app:proxy-server]
use = egg:swift#proxy
allow_account_management = true
account_autocreate = true

[filter:keystoneauth]
use = egg:swift#keystoneauth
operator_roles = Member,admin,swiftoperator

[filter:authtoken]
paste.filter_factory = keystoneclient.middleware.auth_token:filter_factory

# Delaying the auth decision is required to support token-less
# usage for anonymous referrers ('.r:*').
delay_auth_decision = true
# auth_* settings refer to the Keystone server
auth_protocol = http
auth_host = 10.0.0.20
auth_port = 35357
# the service tenant and swift username and password created in Keystone
admin_tenant_name = admin
admin_user = admin
admin_password = mast3r

[filter:cache]
use = egg:swift#memcache

[filter:catch_errors]
use = egg:swift#catch_errors

[filter:healthcheck]
use = egg:swift#healthcheck

container-server.conf:

[DEFAULT]

# Make sure your swift-ring-builder arguments match the bind_ip and bind_port.
# You almost certainly do not want to listen just on loopback unless testing.
# However, you want to keep port 6201 if SElinux is enabled.
bind_ip = 0.0.0.0
bind_port = 6001

workers = 2

[pipeline:main]
pipeline = container-server

[app:container-server]
use = egg:swift#container

[container-replicator]

[container-updater]

[container-auditor]

[container-sync]

account-server.conf:

[DEFAULT]

# Make sure your swift-ring-builder arguments match the bind_ip and bind_port.
# You almost certainly do not want to listen just on loopback unless testing.
# However, you want to ...
(more)
2015-02-19 20:03:43 -0500 received badge  Popular Question (source)
2015-02-19 15:15:22 -0500 answered a question swiftclient:Account HEAD failed 400 Bad Request

In my case, the reason for the 404 error was a mismatch between the swift ring IP ports and the values inside the .config file. With everything else listed as above, my correct values were: account-server.conf - bind_port = 6002; container-server.conf - bind_port = 6001; object-server.conf - bind_port = 6000; proxy-server.conf - bind_port = 8080

2015-02-19 14:28:54 -0500 asked a question swiftclient:Account HEAD failed 400 Bad Request

I have swift and keystone installed atop of Fedora 21. The keystone endpoint is:

cb7628b1341f444586e3a8f1514727c3 | RegionOne | http://127.0.0.1:8080/v2.0/AUTH_c36b8bb29ea947ce922f42389004648b | http://127.0.0.1:8080/v2.0 | http://127.0.0.1:8080/v2.0 | 8c90a8900abe45ad83aa5b04df957e80

The commands I di d to establish the swift rings were:

# swift-ring-builder account.builder add z1-127.0.0.1:6002/partition1 100
# swift-ring-builder container.builder add z1-127.0.0.1:6001/partition1 100
# swift-ring-builder object.builder add z1-127.0.0.1:6000/partition1 100

My proxy-server.conf file is:

[DEFAULT]
bind_port = 8080
user = swift

[pipeline:main]
pipeline = healthcheck cache authtoken keystoneauth proxy-server

[app:proxy-server]
use = egg:swift#proxy
allow_account_management = true
account_autocreate = true

[filter:keystoneauth]
use = egg:swift#keystoneauth
operator_roles = Member,admin,swiftoperator

[filter:authtoken]
paste.filter_factory = keystoneclient.middleware.auth_token:filter_factory

# Delaying the auth decision is required to support token-less
# usage for anonymous referrers ('.r:*').
delay_auth_decision = true
# auth_* settings refer to the Keystone server
auth_protocol = http
auth_host = 127.0.0.1
auth_port = 35357
# the service tenant and swift username and password created in Keystone
admin_tenant_name = admin
admin_user = admin
admin_password = mast3r

[filter:cache]
use = egg:swift#memcache

[filter:catch_errors]
use = egg:swift#catch_errors

[filter:healthcheck]
use = egg:swift#healthcheck

The /etc/memcached.conf file is:

[memcache]
# You can use this single conf file instead of having memcache_servers set in
# several other conf files under [filter:cache] for example. You can specify
# multiple servers separated with commas, as in: 10.1.2.3:11211,10.1.2.4:11211
# memcache_servers = 127.0.0.1:11211
#
# Sets how memcache values are serialized and deserialized:
# 0 = older, insecure pickle serialization
# 1 = json serialization but pickles can still be read (still insecure)
# 2 = json serialization only (secure and the default)
# To avoid an instant full cache flush, existing installations should
# upgrade with 0, then set to 1 and reload, then after some time (24 hours)
# set to 2 and reload.
# In the future, the ability to use pickle serialization will be removed.
# memcache_serialization_support = 2
#
# Sets the maximum number of connections to each memcached server per worker
# memcache_max_connections = 2
#
# Timeout for connection
# connect_timeout = 0.3
# Timeout for pooled connection
# pool_timeout = 1.0
# number of servers to retry on failures getting a pooled connection
# tries = 3
# Timeout for read and writes
# io_timeout = 2.0
-l 127.0.0.1

The object-server.conf file is:

[DEFAULT]

# Make sure your swift-ring-builder arguments match the bind_ip and bind_port.
# You almost certainly do not want to listen just on loopback unless testing.
# However, you want to keep port 6200 if SElinux is enabled.
bind_ip = 127.0.0.1
bind_port = 6002

workers = 3

[pipeline:main]
pipeline = object-server

[app:object-server]
use = egg:swift#object

[object-replicator]

[object-updater]

[object-auditor]

[DEFAULT]

# Make sure your swift-ring-builder arguments match the bind_ip and bind_port.
# You almost certainly do not want to listen just on loopback unless testing.
# However, you want to keep port 6202 if SElinux is enabled.
bind_ip = 127.0.0.1
bind_port = 6202

workers = 2

[pipeline:main]
pipeline = account-server

[app:account-server]
use = egg:swift#account

[account-replicator ...
(more)
2015-02-19 11:34:43 -0500 commented question swiftclient Account HEAD failed 503 internal server error

I made this adjustment, and I'm getting passed the 503 - now I'm hitting a 400 bad request error. I will post that as a separate question

2015-02-19 10:26:04 -0500 asked a question swiftclient Account HEAD failed 503 internal server error

I have installed swift and keystone on top of a fresh Fedora 21

My keystone endpoint looks like this:

6c063f73bc0041e09a0c0d65193e0285 | RegionOne | http://127.0.0.1:8080/v1/AUTH_c36b8bb29ea947ce922f42389004648b | http://127.0.0.1:8080/v1 | http://127.0.0.1:8080/v1 | 8c90a8900abe45ad83aa5b04df957e80

My proxy-server.conf file looks like this:

[DEFAULT]
bind_port = 8080
user = swift

[pipeline:main]
pipeline = healthcheck cache authtoken keystoneauth proxy-server

[app:proxy-server]
use = egg:swift#proxy
allow_account_management = true
account_autocreate = true

[filter:keystoneauth]
use = egg:swift#keystoneauth
operator_roles = Member,admin,swiftoperator

[filter:authtoken]
paste.filter_factory = keystoneclient.middleware.auth_token:filter_factory

# Delaying the auth decision is required to support token-less
# usage for anonymous referrers ('.r:*').
delay_auth_decision = true
# auth_* settings refer to the Keystone server
auth_protocol = http
auth_host = 127.0.0.1
auth_port = 35357
# the service tenant and swift username and password created in Keystone
admin_tenant_name = admin
admin_user = admin
admin_password = mast3r

[filter:cache]
use = egg:swift#memcache

[filter:catch_errors]
use = egg:swift#catch_errors

[filter:healthcheck]
use = egg:swift#healthcheck

My /etc/memcached.conf file looks like this:

[memcache]
# You can use this single conf file instead of having memcache_servers set in
# several other conf files under [filter:cache] for example. You can specify
# multiple servers separated with commas, as in: 10.1.2.3:11211,10.1.2.4:11211
# memcache_servers = 127.0.0.1:11211
#
# Sets how memcache values are serialized and deserialized:
# 0 = older, insecure pickle serialization
# 1 = json serialization but pickles can still be read (still insecure)
# 2 = json serialization only (secure and the default)
# To avoid an instant full cache flush, existing installations should
# upgrade with 0, then set to 1 and reload, then after some time (24 hours)
# set to 2 and reload.
# In the future, the ability to use pickle serialization will be removed.
# memcache_serialization_support = 2
#
# Sets the maximum number of connections to each memcached server per worker
# memcache_max_connections = 2
#
# Timeout for connection
# connect_timeout = 0.3
# Timeout for pooled connection
# pool_timeout = 1.0
# number of servers to retry on failures getting a pooled connection
# tries = 3
# Timeout for read and writes
# io_timeout = 2.0
-l proxy-server-ip 127.0.0.1

The output of keystone tenant-list looks like this:

c36b8bb29ea947ce922f42389004648b | admin |   True

When I run swift --debug stat I get the following error:

INFO:swiftclient:RESP HEADERS: [('date', 'Thu, 19 Feb 2015 16:24:37 GMT'), ('content-length', '0'), ('content-type', 'text/html; charset=UTF-8'), ('connection', 'keep-alive'), ('x-trans-id', 'txb8f78eb0f06d4ab286cc0-0054e60e45')]
DEBUG:requests.packages.urllib3.connectionpool:"HEAD /v1/AUTH_c36b8bb29ea947ce922f42389004648b HTTP/1.1" 503 0
INFO:swiftclient:REQ: curl -i http://127.0.0.1:8080/v1/AUTH_c36b8bb29ea947ce922f42389004648b -I -H "X-Auth-Token: MIIEzwYJKoZIhvcNAQcCoIIEwDCCBLwCAQExCTAHBgUrDgMCGjCCAyUGCSqGSIb3DQEHAaCCAxYEggMSeyJhY2Nlc3MiOiB7InRva2VuIjogeyJpc3N1ZWRfYXQiOiAiMjAxNS0wMi0xOVQxNjoyNDoyMi4zNDg2ODgiLCAiZXhwaXJlcyI6ICIyMDE1LTAyLTE5VDE3OjI0OjIyWiIsICJpZCI6ICJwbGFjZWhvbGRlciIsICJ0ZW5hbnQiOiB7ImRlc2NyaXB0aW9uIjogIkFkbWluIFRlbmFudCIsICJlbmFibGVkIjogdHJ1ZSwgImlkIjogImMzNmI4YmIyOWVhOTQ3Y2U5MjJmNDIzODkwMDQ2NDhiIiwgIm5hbWUiOiAiYWRtaW4ifX0sICJzZXJ2aWNlQ2F0YWxvZyI6IFt7ImVuZHBvaW50cyI6IFt7ImFkbWluVVJMIjogImh0dHA6Ly8xMjcuMC4wLjE6ODA4MC92MSIsICJyZWdpb24iOiAiUmVnaW9uT25lIiwgImludGVybmFsVVJMIjogImh0dHA6Ly8xMjcuMC4wLjE6ODA4MC92MSIsICJpZCI6ICI0NTJlZmM4MTQwMTE0ZDQ0YTA0ZTI1MmU3YjA5NDVlYSIsICJw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:53 GMT'), ('content-length', '0'), ('content-type', 'text/html; charset=UTF-8'), ('connection', 'keep-alive'), ('x-trans-id', 'tx720b6eb7729047939bc80-0054e60e55')]
ERROR:swiftclient:Account HEAD failed: http://127.0.0.1:8080/v1/AUTH_c36b8bb29ea947ce922f42389004648b 503 Internal Server Error
Traceback (most recent call last):
  File "/usr/lib/python2.7/site-packages/swiftclient/client.py", line 1243, in _retry
    rv = func(self.url, self.token, *args, **kwargs ...
(more)
2015-02-19 09:52:03 -0500 commented answer swiftclient Account HEAD failed with 401 Unauthorized

I have modified my proxy-server.conf per your example. Could you, please, post an entire line from the memcached.conf which contains the -l proxy-server-ip line?

2015-02-19 08:57:24 -0500 asked a question swiftclient Account HEAD failed with 401 Unauthorized

I have fresh Fedora 21 install, on top of which I installed keystone and swift.

I ran the following keystone command to establish a swift endpoint:

keystone endpoint-create --region RegionOne --service_id 8c90a8900abe45ad83aa5b04df957e80 --publicurl "http://127.0.0.1:8080/v1/AUTH_c36b8bb29ea947ce922f42389004648b" --adminurl http://127.0.0.1:8080/v1 --internalurl http://127.0.0.1:8080/v1

This endpoint reads like this:

6c063f73bc0041e09a0c0d65193e0285 | RegionOne | http://127.0.0.1:8080/v1/AUTH_c36b8bb29ea947ce922f42389004648b | http://127.0.0.1:8080/v1 | http://127.0.0.1:8080/v1 | 8c90a8900abe45ad83aa5b04df957e80

my proxy-server.conf looks like this:

[DEFAULT]
bind_ip = 0.0.0.0
bind_port = 8080
workers = 8
user = swift

[pipeline:main]
pipeline = healthcheck cache authtoken keystone proxy-server

[app:proxy-server]
use = egg:swift#proxy
allow_account_management = true
account_autocreate = true

[filter:cache]
use = egg:swift#memcache
memcache_servers = 127.0.0.1:11211

[filter:catch_errors]
use = egg:swift#catch_errors

[filter:healthcheck]
use = egg:swift#healthcheck

[filter:keystone]
use = egg:swift#keystoneauth
operator_roles = admin, SwiftOperator
is_admin = true
cache = swift.cache

[filter:authtoken]
paste.filter_factory = keystoneclient.middleware.auth_token:filter_factory
admin_tenant_name = service
admin_user = swift
admin_password = swift
auth_host = 127.0.0.1
auth_port = 35357
auth_protocol = http
auth_uri = http://127.0.0.1:5000
signing_dir = /tmp/keystone-signing-swift

When I attempt to run swift --debug stat I get the following error in my output:

DEBUG:keystoneclient.session:REQ: curl -i -X POST http://127.0.0.1:35357/v2.0/tokens -H "Content-Type: application/json" -H "Accept: application/json" -H "User-Agent: python-keystoneclient" -d '{"auth": {"tenantName": "admin", "passwordCredentials": {"username": "admin", "password": "mast3r"}}}'
INFO:requests.packages.urllib3.connectionpool:Starting new HTTP connection (1): 127.0.0.1
DEBUG:requests.packages.urllib3.connectionpool:"POST /v2.0/tokens HTTP/1.1" 200 2423
DEBUG:keystoneclient.session:RESP: [200] {'date': 'Thu, 19 Feb 2015 14:55:28 GMT', 'content-type': 'application/json', 'content-length': '2423', 'vary': 'X-Auth-Token', 'connection': 'keep-alive'}
RESP BODY: {"access": {"token": {"issued_at": "2015-02-19T14:55:28.411086", "expires": "2015-02-19T15:55:28Z", "id": "MIIEzwYJKoZIhvcNAQcCoIIEwDCCBLwCAQExCTAHBgUrDgMCGjCCAyUGCSqGSIb3DQEHAaCCAxYEggMSeyJhY2Nlc3MiOiB7InRva2VuIjogeyJpc3N1ZWRfYXQiOiAiMjAxNS0wMi0xOVQxNDo1NToyOC40MTEwODYiLCAiZXhwaXJlcyI6ICIyMDE1LTAyLTE5VDE1OjU1OjI4WiIsICJpZCI6ICJwbGFjZWhvbGRlciIsICJ0ZW5hbnQiOiB7ImRlc2NyaXB0aW9uIjogIkFkbWluIFRlbmFudCIsICJlbmFibGVkIjogdHJ1ZSwgImlkIjogImMzNmI4YmIyOWVhOTQ3Y2U5MjJmNDIzODkwMDQ2NDhiIiwgIm5hbWUiOiAiYWRtaW4ifX0sICJzZXJ2aWNlQ2F0YWxvZyI6IFt7ImVuZHBvaW50cyI6IFt7ImFkbWluVVJMIjogImh0dHA6Ly8xMjcuMC4wLjE6ODA4MC92MSIsICJyZWdpb24iOiAiU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BkKGMtUl1WJcYeCg5+Me7NpVjbBFTEq8imSz8nqP7rJINNttWds1Zj3Oin0vzw8lBWVb4=", "tenant": {"description": "Admin Tenant", "enabled": true, "id": "c36b8bb29ea947ce922f42389004648b", "name": "admin"}}, "serviceCatalog": [{"endpoints": [{"adminURL": "http://127.0.0.1:8080/v1", "region": "RegionOne", "internalURL": "http://127.0.0.1:8080/v1", "id": "452efc8140114d44a04e252e7b0945ea", "publicURL": "http://127.0.0.1:8080/v1/AUTH_c36b8bb29ea947ce922f42389004648b"}], "endpoints_links": [], "type": "object-store", "name": "swift"}], "user": {"username": "admin", "roles_links": [], "id": "a2b8e23eaa404378b2fb34cf217efbe9", "roles": [{"name": "admin"}], "name": "admin"}, "metadata": {"is_admin": 0, "roles": ["e3c480c2fd6142f594b8539b002a6b6d"]}}}

WARNING:keystoneclient.httpclient:Failed to retrieve management_url from token
DEBUG:iso8601.iso8601:Parsed 2015-02-19T15:55:28Z into {'tz_sign': None, 'second_fraction': None, 'hour': u'15', 'daydash': u'19', 'tz_hour': None, 'month': None, 'timezone': u'Z', 'second': u'28', 'tz_minute': None, 'year': u'2015', 'separator': u'T', 'monthdash': u'02', 'day': None, 'minute': u'55'} with default timezone <iso8601.iso8601.Utc object at 0x7fca3b68bdd0>
DEBUG:iso8601.iso8601:Got u'2015' for 'year' with default None
DEBUG:iso8601.iso8601:Got u'02' for 'monthdash' with default 1
DEBUG:iso8601.iso8601:Got 2 for 'month' with default 2
DEBUG:iso8601.iso8601:Got u'19' for 'daydash' with default 1
DEBUG:iso8601.iso8601:Got 19 for 'day' with default 19
DEBUG:iso8601.iso8601 ...
(more)
2015-02-19 08:49:31 -0500 answered a question unable to run swift stat

In my proxy-server.conf file I have changed IPs from 10.0.0.20 to 127.0.0.1. This let me pass the connection problem, and now I have a different one - ERROR:swiftclient:Account HEAD failed: http://127.0.0.1:8080/v1/AUTH_c36b8bb... 401 Unauthorized

I will post this one separately.

2015-02-19 08:40:04 -0500 asked a question unable to run swift stat

I have a fresh Fedora 21 install, on which I have installed and configured just swift and keystone I ran the following keystone command:

keystone endpoint-create --region RegionOne --service_id 8c90a8900abe45ad83aa5b04df957e80 --publicurl "http://127.0.0.1:8080/v1/AUTH_c36b8bb29ea947ce922f42389004648b" --adminurl http://127.0.0.1:8080/v1 --internalurl http://127.0.0.1:8080/v1

This gave me the following endpoint definition for swift:

6c063f73bc0041e09a0c0d65193e0285 | RegionOne | http://127.0.0.1:8080/v1/AUTH_c36b8bb29ea947ce922f42389004648b | http://127.0.0.1:8080/v1 | http://127.0.0.1:8080/v1 | 8c90a8900abe45ad83aa5b04df957e80

When I attempt to run swift --debug stat I get the following error:

DEBUG:keystoneclient.session:REQ: curl -i -X POST http://127.0.0.1:35357/v2.0/tokens -H "Content-Type: application/json" -H "Accept: application/json" -H "User-Agent: python-keystoneclient" -d '{"auth": {"tenantName": "admin", "passwordCredentials": {"username": "admin", "password": "mast3r"}}}'
INFO:requests.packages.urllib3.connectionpool:Starting new HTTP connection (1): 127.0.0.1
DEBUG:requests.packages.urllib3.connectionpool:"POST /v2.0/tokens HTTP/1.1" 200 2423
DEBUG:keystoneclient.session:RESP: [200] {'date': 'Thu, 19 Feb 2015 14:32:32 GMT', 'content-type': 'application/json', 'content-length': '2423', 'vary': 'X-Auth-Token', 'connection': 'keep-alive'}
RESP BODY: {"access": {"token": {"issued_at": "2015-02-19T14:32:32.818064", "expires": "2015-02-19T15:32:32Z", "id": "MIIEzwYJKoZIhvcNAQcCoIIEwDCCBLwCAQExCTAHBgUrDgMCGjCCAyUGCSqGSIb3DQEHAaCCAxYEggMSeyJhY2Nlc3MiOiB7InRva2VuIjogeyJpc3N1ZWRfYXQiOiAiMjAxNS0wMi0xOVQxNDozMjozMi44MTgwNjQiLCAiZXhwaXJlcyI6ICIyMDE1LTAyLTE5VDE1OjMyOjMyWiIsICJpZCI6ICJwbGFjZWhvbGRlciIsICJ0ZW5hbnQiOiB7ImRlc2NyaXB0aW9uIjogIkFkbWluIFRlbmFud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yX-262fLJ7zNf57ms3EmL-U5jm-x0KVa08-H5rQ5BA3daj3QyKd8oZFY3f8L6pDEh537XLlkThQYdOd6E1b3PIp+1KgVxVm5Aw-MlaqhEZtj6tr7unb1qTe+OxjctXVFVmxpjereAlnuuUrw6SZTSUiNNWz9E-kWuwfQ1gfekwm1MUU3SQIA1zIqWwfh4f9bkJCYXUBKyhNRpaQsFxDrFDyZdy41mKKPSleNVJz0kTycqqyUTPnRaIEpKnTYM9QPdqrHpwhcm3ntulWKBcj52lsipACGk7o=", "tenant": {"description": "Admin Tenant", "enabled": true, "id": "c36b8bb29ea947ce922f42389004648b", "name": "admin"}}, "serviceCatalog": [{"endpoints": [{"adminURL": "http://127.0.0.1:8080/v1", "region": "RegionOne", "internalURL": "http://127.0.0.1:8080/v1", "id": "452efc8140114d44a04e252e7b0945ea", "publicURL": "http://127.0.0.1:8080/v1/AUTH_c36b8bb29ea947ce922f42389004648b"}], "endpoints_links": [], "type": "object-store", "name": "swift"}], "user": {"username": "admin", "roles_links": [], "id": "a2b8e23eaa404378b2fb34cf217efbe9", "roles": [{"name": "admin"}], "name": "admin"}, "metadata": {"is_admin": 0, "roles": ["e3c480c2fd6142f594b8539b002a6b6d"]}}}

WARNING:keystoneclient.httpclient:Failed to retrieve management_url from token
DEBUG:iso8601.iso8601:Parsed 2015-02-19T15:32:32Z into {'tz_sign': None, 'second_fraction': None, 'hour': u'15', 'daydash': u'19', 'tz_hour': None, 'month': None, 'timezone': u'Z', 'second': u'32', 'tz_minute': None, 'year': u'2015', 'separator': u'T', 'monthdash': u'02', 'day': None, 'minute': u'32'} with default timezone <iso8601.iso8601.Utc object at 0x7fb9df33cdd0>
DEBUG:iso8601.iso8601:Got u'2015' for 'year' with default None
DEBUG:iso8601.iso8601:Got u'02' for 'monthdash' with default 1
DEBUG:iso8601.iso8601:Got 2 for 'month' with default 2
DEBUG:iso8601.iso8601:Got u'19' for 'daydash' with default 1
DEBUG:iso8601.iso8601:Got 19 for 'day' with default 19
DEBUG:iso8601.iso8601:Got u'15' for 'hour' with default None
DEBUG:iso8601.iso8601:Got u'32' for 'minute' with default None
DEBUG:iso8601.iso8601:Got u'32' for 'second' with default None
INFO:requests.packages.urllib3.connectionpool:Starting new HTTP connection (1): 127.0.0.1
INFO:requests.packages.urllib3.connectionpool:Starting new HTTP connection (1): 127.0.0.1
INFO:requests.packages.urllib3.connectionpool:Starting new HTTP connection (1): 127.0.0.1
INFO:requests.packages.urllib3.connectionpool:Starting new HTTP connection (1): 127.0.0.1
INFO:requests.packages.urllib3.connectionpool:Starting new HTTP connection (1): 127.0.0.1
INFO:requests.packages.urllib3.connectionpool:Starting new HTTP connection (1): 127.0.0 ...
(more)
2015-02-19 08:31:59 -0500 received badge  Supporter (source)
2015-02-19 08:31:54 -0500 received badge  Scholar (source)
2015-02-19 08:31:52 -0500 commented answer ERROR:swiftclient:Endpoint for object-store not found - have you specified a region?

you were correct - I did not have an endpoind defined in keystone. now, after I ran keystone endpoint-create I am getting a different error. I will post as a separate question

2015-02-19 00:11:26 -0500 asked a question ERROR:swiftclient:Endpoint for object-store not found - have you specified a region?

I have set up a single-node swift environment on Fedora 21 When I attempt to run swift --debug stat I get this error:

DEBUG:keystoneclient.session:REQ: curl -i -X POST http://127.0.0.1:35357/v2.0/tokens -H "Content-Type: application/json" -H "Accept: application/json" -H "User-Agent: python-keystoneclient" -d '{"auth": {"tenantName": "admin", "passwordCredentials": {"username": "admin", "password": "mast3r"}}}'
INFO:requests.packages.urllib3.connectionpool:Starting new HTTP connection (1): 127.0.0.1
DEBUG:requests.packages.urllib3.connectionpool:"POST /v2.0/tokens HTTP/1.1" 200 1703
DEBUG:keystoneclient.session:RESP: [200] {'date': 'Thu, 19 Feb 2015 06:09:43 GMT', 'content-type': 'application/json', 'content-length': '1703', 'vary': 'X-Auth-Token', 'connection': 'keep-alive'}
RESP BODY: {"access": {"token": {"issued_at": "2015-02-19T06:09:43.012464", "expires": "2015-02-19T07:09:43Z", "id": "MIIDmwYJKoZ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pla2uJH0C0yX3Qh8S1bP5Afr5ihgdjQaqLdUzY1Duh4mAJhjrUEJJL3HID3yVE-vTbVzWPHyK1pCIDlu5J9cnQ0mMEHsdj0dp-3o4XDiEL+OKyPJCaQFUeaTVeVLDjjYSUx2beOiJKoqd6FxxgCxa8QMlO9YO27", "tenant": {"description": "Admin Tenant", "enabled": true, "id": "c36b8bb29ea947ce922f42389004648b", "name": "admin"}}, "serviceCatalog": [], "user": {"username": "admin", "roles_links": [], "id": "a2b8e23eaa404378b2fb34cf217efbe9", "roles": [{"name": "admin"}], "name": "admin"}, "metadata": {"is_admin": 0, "roles": ["e3c480c2fd6142f594b8539b002a6b6d"]}}}

WARNING:keystoneclient.httpclient:Failed to retrieve management_url from token
ERROR:swiftclient:Endpoint for object-store not found - have you specified a region?
Traceback (most recent call last):
  File "/usr/lib/python2.7/site-packages/swiftclient/client.py", line 1235, in _retry
    self.url, self.token = self.get_auth()
  File "/usr/lib/python2.7/site-packages/swiftclient/client.py", line 1209, in get_auth
    insecure=self.insecure)
  File "/usr/lib/python2.7/site-packages/swiftclient/client.py", line 406, in get_auth
    auth_version=auth_version)
  File "/usr/lib/python2.7/site-packages/swiftclient/client.py", line 352, in get_auth_keystone
    'have you specified a region?' % service_type)
ClientException: Endpoint for object-store not found - have you specified a region?
Traceback (most recent call last):
  File "/bin/swift", line 11, in <module>
    sys.exit(main())
  File "/usr/lib/python2.7/site-packages/swiftclient/shell.py", line 1287, in main
    globals()['st_%s' % args[0]](parser, argv[1:], output)
  File "/usr/lib/python2.7/site-packages/swiftclient/shell.py", line 492, in st_stat
    stat_result = swift.stat()
  File "/usr/lib/python2.7/site-packages/swiftclient/service.py", line 443, in stat
    raise SwiftError('Account not found', exc=err)
swiftclient.service.SwiftError: 'Account not found'

What can I do to fix this?

2015-02-19 00:11:01 -0500 asked a question ERROR:swiftclient:Endpoint for object-store not found - have you specified a region?

I have set up a single-node swift environment on Fedora 21 When I attempt to run swift --debug stat I get this error:

DEBUG:keystoneclient.session:REQ: curl -i -X POST http://127.0.0.1:35357/v2.0/tokens -H "Content-Type: application/json" -H "Accept: application/json" -H "User-Agent: python-keystoneclient" -d '{"auth": {"tenantName": "admin", "passwordCredentials": {"username": "admin", "password": "mast3r"}}}'
INFO:requests.packages.urllib3.connectionpool:Starting new HTTP connection (1): 127.0.0.1
DEBUG:requests.packages.urllib3.connectionpool:"POST /v2.0/tokens HTTP/1.1" 200 1703
DEBUG:keystoneclient.session:RESP: [200] {'date': 'Thu, 19 Feb 2015 06:09:43 GMT', 'content-type': 'application/json', 'content-length': '1703', 'vary': 'X-Auth-Token', 'connection': 'keep-alive'}
RESP BODY: {"access": {"token": {"issued_at": "2015-02-19T06:09:43.012464", "expires": "2015-02-19T07:09:43Z", "id": "MIIDmwYJKoZIhvcNAQcCoIIDjDCCA4gCAQExCTAHBgUrDgMCGjCCAfEGCSqGSIb3DQEHAaCCAeIEggHeeyJhY2Nlc3MiOiB7InRva2VuIjogeyJpc3N1ZWRfYXQiOiAiMjAxNS0wMi0xOVQwNjowOTo0My4wMTI0NjQiLCAiZXhwaXJlcyI6ICIyMDE1LTAyLTE5VDA3OjA5OjQzWiIsICJpZCI6ICJwbGFjZWhvbGRlciIsICJ0ZW5hbnQiOiB7ImRlc2NyaXB0aW9uIjogIkFkbWluIFRlbmFudCIsICJlbmFibGVkIjogdHJ1ZSwgImlkIjogImMzNmI4YmIyOWVhOTQ3Y2U5MjJmNDIzODkwMDQ2NDhiIiwgIm5hbWUiOiAiYWRtaW4ifX0sICJzZXJ2aWNlQ2F0YWxvZyI6IFtdLCAidXNlciI6IHsidXNlcm5hbWUiOiAiYWRtaW4iLCAicm9sZXNfbGlua3MiOiBbXSwgImlkIjogImEyYjhlMjNlYWE0MDQzNzhiMmZiMzRjZjIxN2VmYmU5IiwgInJvbGVzIjogW3sibmFtZSI6ICJhZG1pbiJ9XSwgIm5hbWUiOiAiYWRtaW4ifSwgIm1ldGFkYXRhIjogeyJpc19hZG1pbiI6IDAsICJyb2xlcyI6IFsiZTNjNDgwYzJmZDYxNDJmNTk0Yjg1MzliMDAyYTZiNmQiXX19fTGCAYEwggF9AgEBMFwwVzELMAkGA1UEBhMCVVMxDjAMBgNVBAgMBVVuc2V0MQ4wDAYDVQQHDAVVbnNldDEOMAwGA1UECgwFVW5zZXQxGDAWBgNVBAMMD3d3dy5leGFtcGxlLmNvbQIBATAHBgUrDgMCGjANBgkqhkiG9w0BAQEFAASCAQAQBF9j2Gjznh8ZLT70jHqOFAZ73AXkmn7NYshxi7VDJ1oZQSjIRoMLJCLkXzA04WkBbPO3RxsMjzTgC55ERWwL57dr+trx7u-SCwrox1yhft+OlxgV9LVvpdCYSiqM9tGkP8qU60vQnxCGb7ykaClH0R6wBV2z7pjJBocHogfdY9YOacq9pXlmjpla2uJH0C0yX3Qh8S1bP5Afr5ihgdjQaqLdUzY1Duh4mAJhjrUEJJL3HID3yVE-vTbVzWPHyK1pCIDlu5J9cnQ0mMEHsdj0dp-3o4XDiEL+OKyPJCaQFUeaTVeVLDjjYSUx2beOiJKoqd6FxxgCxa8QMlO9YO27", "tenant": {"description": "Admin Tenant", "enabled": true, "id": "c36b8bb29ea947ce922f42389004648b", "name": "admin"}}, "serviceCatalog": [], "user": {"username": "admin", "roles_links": [], "id": "a2b8e23eaa404378b2fb34cf217efbe9", "roles": [{"name": "admin"}], "name": "admin"}, "metadata": {"is_admin": 0, "roles": ["e3c480c2fd6142f594b8539b002a6b6d"]}}}

WARNING:keystoneclient.httpclient:Failed to retrieve management_url from token
ERROR:swiftclient:Endpoint for object-store not found - have you specified a region?
Traceback (most recent call last):
  File "/usr/lib/python2.7/site-packages/swiftclient/client.py", line 1235, in _retry
    self.url, self.token = self.get_auth()
  File "/usr/lib/python2.7/site-packages/swiftclient/client.py", line 1209, in get_auth
    insecure=self.insecure)
  File "/usr/lib/python2.7/site-packages/swiftclient/client.py", line 406, in get_auth
    auth_version=auth_version)
  File "/usr/lib/python2.7/site-packages/swiftclient/client.py", line 352, in get_auth_keystone
    'have you specified a region?' % service_type)
ClientException: Endpoint for object-store not found - have you specified a region?
Traceback (most recent call last):
  File "/bin/swift", line 11, in <module>
    sys.exit(main())
  File "/usr/lib/python2.7/site-packages/swiftclient/shell.py", line 1287, in main
    globals()['st_%s' % args[0]](parser, argv[1:], output)
  File "/usr/lib/python2.7/site-packages/swiftclient/shell.py", line 492, in st_stat
    stat_result = swift.stat()
  File "/usr/lib/python2.7/site-packages/swiftclient/service.py", line 443, in stat
    raise SwiftError('Account not found', exc=err)
swiftclient.service.SwiftError: 'Account not found'

What can I do to fix this?

2015-02-13 08:25:17 -0500 received badge  Taxonomist
2015-02-04 00:28:05 -0500 received badge  Famous Question (source)
2015-02-04 00:28:05 -0500 received badge  Notable Question (source)
2015-01-31 13:07:40 -0500 asked a question how to add fields to a form dynamically

Is there a way to add fields to a SelfHandlingForm dynamically during the __init__ ? I have a form, which is used to place an order. Each item in the order has a couple of attribute values, which can only be specified during ordering of an item. Depending n how many iets are being ordered, I need to add the fields for each item to the order form. Is there a way to do that in Horizon Forms?

2015-01-30 09:23:23 -0500 received badge  Popular Question (source)
2015-01-29 16:02:03 -0500 answered a question How to properly call __init__ on Horizon workflows.Action

All I had to do, is not to include these into the top-level init:

 image_choices=image_choices, flavor_choices=flavor_choices,

So the working version looks like this:

class SetWorkflowInfoAction(workflows.Action):
    name = forms.CharField(max_length="255", label=_("Workload Name"))
    description = forms.CharField(widget=forms.Textarea,
                                  label=_("Description"), required=False)
    image_choices = []
    images = forms.ChoiceField(label=_("Images"), choices=image_choices)
    flavor_choices = []
    flavors = forms.ChoiceField(label=_("Flavors"), choices=flavor_choices)

    def __init__(self, request,
                 *args, **kwargs):
        super(SetWorkflowInfoAction, self).__init__(request, *args, **kwargs)

        image_choices = []
        flavor_choices = []

        images, self._more, self._prev = api.glance.image_list_detailed(
            self.request)
        flavors = api.nova.flavor_list(request, True)

        for image in images:
                image_choices.append((image.id, image.name))
        if len(image_choices) > 1:
            image_choices.insert(0, ('', _("Select an Image")))
        self.fields['images'].choices = image_choices

        for flavor in flavors:
                flavor_choices.append((flavor.id, flavor.name))
        if len(flavor_choices) > 1:
            flavor_choices.insert(0, ('', _("Select an Flavor")))
        self.fields['flavors'].choices = flavor_choices

    class Meta:
        name = _("Basic Workload Information")
        help_text = _("")
        slug = "set_workflow_info"
2015-01-29 11:48:35 -0500 asked a question How to properly call __init__ on Horizon workflows.Action

In my custom Workflow, I have an action, which, among other things, should present the user with a list of available OpenStack images and flavors. My assumption is, that the best place to populate those two lists are within the __init__ method. Currently, mine looks like this:

class SetWorkflowInfoAction(workflows.Action):
    name = forms.CharField(max_length="255", label=_("Workload Name"))
    description = forms.CharField(widget=forms.Textarea,
                                  label=_("Description"), required=False)
    image_choices = []
    images = forms.ChoiceField(label=_("Images"), choices=image_choices)
    flavor_choices = []
    flavors = forms.ChoiceField(label=_("Flavors"), choices=flavor_choices)

    def __init__(self, request, image_choices=image_choices, flavor_choices=flavor_choices,
                 *args, **kwargs):
        super(SetWorkflowInfoAction, self).__init__(request, *args, **kwargs)

        image_choices = []
        flavor_choices = []

        images, self._more, self._prev = api.glance.image_list_detailed(
            self.request)
        flavors = api.nova.flavor_list(request, True)

        for image in images:
                image_choices.append((image.id, image.name))
        if len(image_choices) > 1:
            image_choices.insert(0, ('', _("Select an Image")))
        self.fields['images'].choices = image_choices

        for flavor in flavors:
                flavor_choices.append((flavor.id, flavor.name))
        if len(flavor_choices) > 1:
            flavor_choices.insert(0, ('', _("Select an Flavor")))
        self.fields['flavors'].choices = flavor_choices

    class Meta:
        name = _("Basic Workload Information")
        help_text = _("")
        slug = "set_workflow_info"

The trouble is - when I get to the point of calling __init__ I get this error:

File "/home/eugene/dev/horizon/openstack_dashboard/dashboards/mydashboard/workloads_panel/workflows.py", line 20, in __init__
    super(SetWorkflowInfoAction, self).__init__(request, *args, **kwargs)
TypeError: __init__() takes at least 3 arguments (2 given)

What is the proper way to call __init__ in such a way, so I could populate my images and flavors lists?

2015-01-25 09:06:18 -0500 answered a question How to dynamically update the 'initial' value in a Form ChoiceField

As it turns out, this was the actually correct syntax:

class UpdateWorkload(forms.SelfHandlingForm): name = forms.CharField(max_length="255", label=_("Workload Name")) description = forms.CharField(widget=forms.Textarea, label=_("Description"), required=False) image_choices = [] images = forms.ChoiceField(label=_("Images"), choices=image_choices) flavor_choices = [] flavors = forms.ChoiceField(label=_("Flavors"), choices=flavor_choices)

def __init__(self, request, image_choices=image_choices, flavor_choices=flavor_choices,
             *args, **kwargs):
    super(UpdateWorkload, self).__init__(request, *args, **kwargs)

    images, self._more, self._prev = api.glance.image_list_detailed(
        self.request)
    flavors = api.nova.flavor_list(request, True)

    for image in images:
            image_choices.append((image.id, image.name))
    if len(image_choices) > 1:
        image_choices.insert(0, ('', _("Select an Image")))
    self.fields['images'].choices = image_choices

    for flavor in flavors:
            flavor_choices.append((flavor.id, flavor.name))
    if len(flavor_choices) > 1:
        flavor_choices.insert(0, ('', _("Select an Flavor")))
    self.fields['flavors'].choices = flavor_choices
    selected_workload = kwargs['initial']
    selected_image = selected_workload['image']
    selected_flavor = selected_workload['flavor']

    self.fields['images'].initial = selected_image
    self.fields['flavors'].initial = selected_flavor