python keystoneclient AttributeError: 'RoleManager' object has no attribute 'add'
Using python shell, I execute this script:
keystone.roles.add_user_role(user='aji2', project='project.aji', role='role.aji')
and the result is this:
Traceback (most recent call last): File "<stdin>", line 1, in <module> AttributeError: 'RoleManager' object has no attribute 'add'
I think 'add' exists according to this documentation: role add
openstack role add --domain | --project [--project-domain ] --user [--user-domain ] | --group [--group-domain ] --role-domain --inherited
beg for a solution. thanks.
See also questions close to this topic
How can I simplify complex many-to-many relationships in Django models
I've searched around for a while, but can't seem to find an existing question that covers this or I'm missing the terminology to find it.
I'm trying to capture a relationship similar to the following example of fruit sellers in Django models.
- Seller A sells Apples, Pears and Bananas in London, Berlin and Paris
- Seller B sells Apples, Pears and Bananas in London but only Pears in Berlin and Bananas in Paris
- Seller C sells only Apples and Bananas in Paris
What I have at the moment looks like this:
class City(models.Model): name = models.CharField(max_length=200) class Region(models.Model): name = models.CharField(max_length=200) cities = models.ManyToManyField(City) class Fruit(models.Model): name = models.CharField(max_length=200) class Coverage(models.Model): name = models.CharField(max_length=200) regions = models.ManyToManyField(Region) fruits = models.ManyToManyField(Fruit) class FruitSeller(models.Model): name = models.CharField(max_length=200) coverage = models.ManyToManyField(Coverage)
This works but all the ManyToMany fields make it feel unnecessarily complex and not very elegant. Ultimately I need to be able to query things like ‘Who sells Apples in London’ ‘Where are Bananas sold’, ‘What fruit does Seller A sell’.
I've also considered adding another model 'Market' which foreign keys to fruitseller, region and fruit which would allow things like
Market.filter(Region__name='Western Europe', fruit__name='Apple').values('FruitSeller__name')That feels much simpler but I think makes adding new fruit sellers via the admin page a bit of a tedious exercise as I believe I would need to add each relationship individually.
What is the best approach to this?
How to drop the constant from ARMA model?
Im estimating an ARMA model, with exegenous variables. The default model estimates it with a constant, but it is insignificant and I would like to drop the constant from my model. How can I do that?
how to create an uninterruptable state process with python?
I would like to create a python process in uninterruptable state (like waiting for IO).
You can not kill such kind process unless reboot your server. So how could we do it in python?
Keystone error 401 output to every command/Keystone don't know Default Openstack Domain
I am currently trying to install Openstack for the first time. I followed the installation guide given by Openstack (here)
The basic setup is done , and I am now trying to install the four "basic" services of Openstack : Keystone, Glance , Nova and Neutron. But I have an error with Keystone , I followed the tutorial , but when I am trying to test Keystone , by launching even the simplest command (
openstack role create myrolefor example) I have the following message
The request you have made requires authentication. (HTTP 401) (Request-ID: req-e9164787-381f-4f69-af7f-7ea4932c3a0b)
As you can see in the keystone.log , I have the message
2019-01-16 20:45:53.064 7056 WARNING keystone.auth.core [req-fd1b7466-cf24-406f-82ce-2549156ae4d6 - - - - -] Could not find domain: default.: DomainNotFound: Could not find domain: default.
It seems that Keystone do not know the Default Domain , how can I change that.
I have already tried "Default" and "default' (with and without the lower-case) , but no change.
I cannot even create another domain , or create a Token (I read on other thread that it might be the problem source)
Let me know if you need anything more , and thanks in advance !
how spark writes several G bytes files to openstack swift
is there any way for spark to write large files (several G bytes) to openstack swift directly? I am reading https://spark.apache.org/docs/2.3.0/storage-openstack-swift.html, but it seems that spark can read from openstack swift. but how about large file writing? Are there any documents or examples for this?
Thanks in advance.
How to allow users with the member role to upload images as public in an Openstack Cloud?
I've tried changing the /etc/glance/policy.json and setting the following:
And then restarting both the glance-api and glance-registry services but of course that would be too easy so it doesn't work :)
validate username password on android application from openstack keystone
i referred following example OpenStack- KeyStone connection to Android Project
But it returned http/1.1 400 bad request.
Following line is wrong. i can not use json parameter inside StringEntity()
StringEntity params1 = new StringEntity(auth.toJSONString());
Can you tell me why my code is not working?
HttpClient httpclient = new DefaultHttpClient(); HttpPost httppost = new HttpPost("http://x.x.x.x:5000/v3/auth/tokens"); JSONObject auth = new JSONObject(); JSONObject json = new JSONObject(); auth.put("auth", json); JSONObject pCredentials = new JSONObject(); json.put("passwordCredentials:", pCredentials); pCredentials.put("username", "user"); pCredentials.put("password", "password"); json.put("tenantName","weatherdata"); Log.i("TAG", "passing your data"+auth.toString()); StringEntity params1 = new StringEntity(auth.toString()); params1.setContentEncoding("UTF-8"); params1.setContentType("application/json"); httppost.setHeader("Content-type", "application/json"); httppost.setEntity(params1); // Execute HTTP Post Request HttpResponse response = httpclient.execute(httppost); Log.i("TAG", "Server response is "+response);
How to get region name in custom heat resource?
I have an OpenStack deployment with 2 regions. Keystone and Horizon are common for both regions. And each region has its own Nova, Heat, Neutron, Glance etc.
I am writing a custom heat resource which should behave differently depending on the region in which the stack is created. Therefore, I am looking for a way to get the region name in the custom heat resource.
I tried to experiment with different methods of keystoneclient, i.e.:
auth = keystoneclient.auth.identity.v3.Token( auth_url=auth_url, token=token, reauthenticate=False) session = keystoneclient.session.Session(auth=auth) keystone_client = keystoneclient.v3.client.Client(session=session) endpoint_manager = keystoneclient.v3.endpoints.EndpointManager(keystone_client) endpoint_list = endpoint_manager.list()
This code returns an error:
2018-12-06 14:27:11.885 1305729 TRACE heat.engine.resource File "/usr/lib/python2.7/site-packages/keystoneclient/service_catalog.py", line 216, in url_for 2018-12-06 14:27:11.885 1305729 TRACE heat.engine.resource raise exceptions.EmptyCatalog(_('The service catalog is empty.')) 2018-12-06 14:27:11.885 1305729 TRACE heat.engine.resource EmptyCatalog: The service catalog is empty.
Is there a "standard" way of getting the region name of your "own" region?