On Mon, Aug 20, 2018, 2:59 AM Benjamin Cherian <benjamin.cherian@xxxxxxxxx> wrote:
Ok...after a bit more searching. I realized you can specify the username directly in the constructor of the "Rados" object. I'm still not entirely clear how one would do it through the config file, but this works for me as well.import radoscluster = rados.Rados(conffile="python_ceph.conf", rados_id="dms")cluster.connect() # No exception when using keyring containing key for dms user!Regards,
Benjamin CherianOn Sun, Aug 19, 2018 at 9:55 PM, Benjamin Cherian <benjamin.cherian@xxxxxxxxx> wrote:Hi David,Thanks for the reply...I had thought there might be something simple like this, do you know what key I should use in the config file to specify the user? I didn't see anything related to user specification in the documentation.Thanks,BenOn Sun, Aug 19, 2018 at 8:02 PM, David Turner <drakonstein@xxxxxxxxx> wrote:You are not specifying which user you are using. Your config file specifies the keyring, but it's still trying to use the default user admin. If you specify that in your python you'll be good to go.On Sun, Aug 19, 2018, 9:17 PM Benjamin Cherian <benjamin.cherian@xxxxxxxxx> wrote:_______________________________________________Hi,I'm trying to write a simple test application using the Python 3 RADOS API. I've made a separate keyring for my application with the same permissions as the admin keyring, but I can't seem to use it to connect to my cluster. The only keyring that seems to work is the client.admin keyring. Does anyone have any experience with this issue?Cluster info:OS: Ubuntu 18.04.1Ceph: Mimic 13.2.1 (from Ceph repository)Attempting to connect to the cluster using python3-rados or python-rados results in the following error:>>> import rados>>> cluster = rados.Rados(conffile="python_ceph.conf")>>> cluster.connect()Traceback (most recent call last):File "<stdin>", line 1, in <module>File "rados.pyx", line 895, in rados.Rados.connectFile "rados.pyx", line 474, in rados.make_exTypeError: InvalidArgumentError does not take keyword argumentsContents of python_ceph.conf:[global]cluster network = 0.0.0.0/0fsid = 518403a0-6b6f-42b8-be99-e58788bee5c2mon host = <redacted>mon initial members = <hostname of monitor>mon_allow_pool_delete = Trueosd crush chooseleaf type = 0public network = 0.0.0.0/0keyring = /etc/ceph/ceph.client.dms.keyring # Everything works ok if i use client.adming.keyringOutput of ceph auth ls...client.adminkey: <Redacted>caps: [mds] allow *caps: [mgr] allow *caps: [mon] allow *caps: [osd] allow *...client.dmskey: <redacted, but matches contents of keyring file>caps: [mgr] allow *caps: [mon] allow *caps: [osd] allow *...What's even more odd is that I can use client.dms keyring with the ceph command line program without issues...e.g., "ceph --user dms status" does not result in any errors has the same output as "ceph --user admin status"Does anyone have any thoughts on what could be causing this issue?Thanks,Ben
ceph-users mailing list
ceph-users@xxxxxxxxxxxxxx
http://lists.ceph.com/listinfo.cgi/ceph-users-ceph.com
_______________________________________________ ceph-users mailing list ceph-users@xxxxxxxxxxxxxx http://lists.ceph.com/listinfo.cgi/ceph-users-ceph.com