Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

hello,i got a problem when i run module #23

Open
gitxuebo opened this issue Feb 13, 2017 · 1 comment
Open

hello,i got a problem when i run module #23

gitxuebo opened this issue Feb 13, 2017 · 1 comment

Comments

@gitxuebo
Copy link

i follow you guide,pip install python-cephclient,and write the code:
from cephclient.wrapper import *

wrapper = CephWrapper(
endpoint = 'http://127.0.0.1:5000/api/v0.1/',
debug = True
)

response, body = wrapper.get_fsid(body = 'json')

but i got the problem :
response, body = wrapper.get_fsid(body = 'json')
AttributeError: 'CephWrapper' object has no attribute 'get_fsid'
there is not attribute 'get_fsid',what is the problem?

@ReneTrippen
Copy link

ReneTrippen commented Jun 13, 2017

The names of the calls have changed since this commit c036013#diff-9c930d9fad412c650eb421b00977c1ac
So your call should look like this
response, body = wrapper.sid(body = 'json')
and you have to import a json lib

from cephclient.wrapper import *
import json

wrapper = CephWrapper(
    endpoint = 'http://127.0.0.1:5000/api/v0.1/',
    debug = True # Optionally increases the verbosity of the client
)


response, body = wrapper.fsid(body = 'json')
print('Response: {0}, Body:\n{1}'.format(response, json.dumps(body, indent=4, separators=(',', ': '))))

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants