Ask Your Question
2

What causes 'Namespace' object has no attribute 'volume' restoring a Cinder backup?

asked 2014-04-29 08:14:26 -0500

Deeptanshu gravatar image

updated 2014-05-02 15:35:23 -0500

smaffulli gravatar image

Hi,

I am getting the below error while restoring the cinder backup. Please check and suggest.

ERROR: 'Namespace' object has no attribute 'volume'

 cinder --debug backup-restore  1634f03a-89a8-498e-99f3-6c8fa73d45c8

REQ: curl -i http://controller:35357/v2.0/tokens -X POST -H "Content-Type: application/json" -H "Accept: application/json" -H "User-Agent: python-cinderclient" -d '{"auth": {"tenantName": "admin", "passwordCredentials": {"username": "admin", "password": "znet@123"}}}'

RESP: [200] CaseInsensitiveDict({'date': 'Tue, 29 Apr 2014 13:10:50 GMT', 'vary': 'X-Auth-Token', 'content-length': '6995', 'content-type': 'application/json'})
RESP BODY: {"access": {"token": {"issued_at": "2014-04-29T13:10:50.598325", "expires": "2014-04-30T13:10:50Z", "id": "MIIMdwYJKoZIhvcNAQcCoIIMaDCCDGQCAQExCTAHBgUrDgMCGjCCCs0GCSqGSIb3DQEHAaCCCr4Eggq6eyJhY2Nlc3MiOiB7InRva2VuIjogeyJpc3N1ZWRfYXQiOiAiMjAxNC0wNC0yOVQxMzoxMDo1MC41OTgzMjUiLCAiZXhwaXJlcyI6ICIyMDE0LTA0LTMwVDEzOjEwOjUwWiIsICJpZCI6ICJwbGFjZWhvbGRlciIsICJ0ZW5hbnQiOiB7ImRlc2NyaXB0aW9uIjogIkFkbWluIFRlbmFudCIsICJlbmFibGVkIjogdHJ1ZSwgImlkIjogImQ3NjBkODM2MmYwMzQ5Y2M5OTAwN2Q4NTE2MGNmOTg2IiwgIm5hbWUiOiAiYWRtaW4ifX0sICJzZXJ2aWNlQ2F0YWxvZyI6IFt7ImVuZHBvaW50cyI6IFt7ImFkbWluVVJMIjogImh0dHA6Ly9jb250cm9sbGVyOjg3NzQvdjIvZDc2MGQ4MzYyZjAzNDljYzk5MDA3ZDg1MTYwY2Y5ODYiLCAicmVnaW9uIjogInJ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VBAgMBVVuc2V0MQ4wDAYDVQQHDAVVbnNldDEOMAwGA1UECgwFVW5zZXQxGDAWBgNVBAMMD3d3dy5leGFtcGxlLmNvbQIBATAHBgUrDgMCGjANBgkqhkiG9w0BAQEFAASCAQAzgYQOiNg88DWkY3OvkgO78fxTnE7WhNjXCUqyvP9dl8Nn6KtMZnjnGa8akerv6VKgxhT7UfwLHSM0g+MevsjAdVblgedEazQOuYBX0JvNcEoCmQobB6q+uSU1R+qdGQDNjX2Qe4Talwl9hi5WTrtNpmmJTeg5zXoNrvZbPUJSoOrj-2ZE01wyuYzDAY4oGUb51zQokyoPd1KxRsNlx8fpCsAZpUtH-XCnGZbEGjx7Hx6u4qnu1XhPiiLBPTMoCjn88TRnYt+hRklzKdLPVhZWQw1H5VSSd+oWZhASbf+64Zus5oy4Cx0SYfnc1OUzlBE76JxlEFJWHXJzdXvw6Vgy", "tenant": {"description": "Admin Tenant", "enabled": true, "id": "d760d8362f0349cc99007d85160cf986", "name": "admin"}}, "serviceCatalog": [{"endpoints": [{"adminURL": "http://controller:8774/v2/d760d8362f0349cc99007d85160cf986", "region": "regionOne", "internalURL": "http://controller:8774/v2/d760d8362f0349cc99007d85160cf986", "id": "73aec839b2a048cca311613a729f4370", "publicURL": "http://controller:8774/v2/d760d8362f0349cc99007d85160cf986"}], "endpoints_links": [], "type": "compute", "name": "nova"}, {"endpoints": [{"adminURL": "http://controller:8776/v2/d760d8362f0349cc99007d85160cf986", "region": "regionOne", "internalURL": "http://controller:8776/v2/d760d8362f0349cc99007d85160cf986", "id": "708ee7c3b79a426baf9093f97c30c89c", "publicURL": "http://controller:8776/v2/d760d8362f0349cc99007d85160cf986"}], "endpoints_links": [], "type": "volumev2", "name": "cinderv2"}, {"endpoints": [{"adminURL": "http://controller:9292", "region": "regionOne", "internalURL": "http://controller:9292", "id": "2a6a95aa6cdd4e479a787910d023415a", "publicURL": "http://controller:9292"}], "endpoints_links": [], "type": "image", "name": "glance"}, {"endpoints": [{"adminURL": "http://controller:8777", "region": "regionOne", "internalURL": "http://controller:8777", "id": "0f7bc74660544490857fcf8b0c58d20e", "publicURL": "http://controller:8777"}], "endpoints_links": [], "type": "metering", "name": "ceilometer"}, {"endpoints": [{"adminURL": "http://controller:8776/v1/d760d8362f0349cc99007d85160cf986", "region": "regionOne", "internalURL": "http://controller:8776/v1/d760d8362f0349cc99007d85160cf986", "id": "549a3d6b80834cbf9e11285f19a43341", "publicURL": "http://controller:8776/v1/d760d8362f0349cc99007d85160cf986"}], "endpoints_links": [], "type": "volume", "name": "cinder"}, {"endpoints": [{"adminURL": "http://172.17.1.30:8080", "region": "regionOne", "internalURL": "http:// 172.17.1.30:8080/v1/AUTH_d760d8362f0349cc99007d85160cf986", "id": "048e1d07980d4d4580892a380a414a95", "publicURL": "http://172.17.1.30:8080/v1/AUTH_d760d8362f0349cc99007d85160cf986"}], "endpoints_links": [], "type": "object-store", "name": "swift"}, {"endpoints": [{"adminURL": "http://controller:35357/v2.0", "region": "regionOne", "internalURL": "http://controller:5000/v2.0", "id": "477cfe1f79de4fe0b29efc9456c40dbe", "publicURL": "http://controller:5000/v2.0"}], "endpoints_links": [], "type": "identity", "name": "keystone"}], "user": {"username": "admin", "roles_links": [], "id": "6c0caa3e1e4f4823a858821aaa31663f", "roles": [{"name": "admin"}], "name": "admin"}, "metadata": {"is_admin": 0, "roles": ["f5f9f0cb0d2e408bacbb736d4dccea7c"]}}}

DEBUG (shell:523) 'Namespace' object has no attribute 'volume'
Traceback (most recent call last):
  File "/usr/lib/python2.7/dist-packages/cinderclient/shell.py", line 518, in main
    sys.argv[1:]))
  File "/usr/lib/python2.7/dist-packages/cinderclient/shell.py", line 464, in main
    args.func(self.cs, args)
  File "/usr/lib/python2.7/dist-packages/cinderclient/v1/shell.py", line 815, in do_backup_restore
    if args.volume:
AttributeError: 'Namespace' object has no attribute 'volume'
ERROR: 'Namespace' object has no attribute 'volume'
edit retag flag offensive close merge delete

1 answer

Sort by ยป oldest newest most voted
1

answered 2014-06-15 09:47:08 -0500

There is bug opened for that: https://bugs.launchpad.net/python-cin... and fix which is merged into python-cinderclient package: https://github.com/openstack/python-c...

However it isn't available in latest Havana release (Ubuntu precise), so you can just apply it manually by changing (/usr/share/pyshared/cinderclient/v1/shell.py):

815    -    if args.volume:
816    -        volume_id = utils.find_volume(cs, args.volume).id

815    +    if args.volume_id:
816    +        volume_id = utils.find_volume(cs, args.volume_id).id

If you are using v2 API apply same patch in /usr/share/pyshared/cinderclient/v2/shell.py

This should resolve error message you got.

edit flag offensive delete link more

Your Answer

Please start posting anonymously - your entry will be published after you log in or create a new account.

Add Answer

[hide preview]

Get to know Ask OpenStack

Resources for moderators

Question Tools

1 follower

Stats

Asked: 2014-04-29 08:14:26 -0500

Seen: 708 times

Last updated: Jun 15 '14