Comments (4)
What do you get if you assign the results from UpdatePolicyDetails to a variable before calling update_policy? Like the snippet below.
policy_details = oci.identity.models.UpdatePolicyDetails(statements=template_stmt)
print(policy_details)
The exception you are getting looks like it is coming back from the service, which makes me think that the issue isn't passing a list of strings into UpdatePolicyDetails.
statements_to_be_added is already a list of strings. If you don't see anything wrong with policy_details when you print it and are still getting an error, you can skip the loop and do this.
policy_details = oci.identity.models.UpdatePolicyDetails(statements=statements_to_add))
and use that policy_details when calling update_policy.
from oci-python-sdk.
The print worked flawlessly as you suggested. I think the issue might actually be when calling update_policy
on identity object.
policy_details = oci.identity.models.UpdatePolicyDetails(statements=statements_to_add))
print(policy_details)
identity.update_policy(policyid, policy_details)
#policyid is a string var
It is still complaining :
oci.exceptions.ServiceError: {'opc-request-id': '8E23F8431FAD4EDA86A7FDA768144A2B/6BDF2E34600832D720EA02CF8134023A/F9FE1ADB1B48ADC72E02D22B11E34734', 'code': 'InvalidParameter', 'message': "'syntax error starting with <<EOF>>'@'line 1, char 73' \n", 'status': 400}
from oci-python-sdk.
This leads me to think there is something off in the policy statements that are being sent. If there is no confidential information, would you be willing to post the results from printing policy_details?
Based on the examples you have provided, I expect it to look like this:
{
"defined_tags": null,
"description": null,
"freeform_tags": null,
"statements": [
"ALLOW group EXAMPLE TO MANAGE users IN TENANCY"
],
"version_date": null
}
When I use that as my policy_details when calling update_policy I get an exception, but it's because I don't have a group named EXAMPLE.
'message': 'The group EXAMPLE specified in the policy statement does not exist under current compartment hierarchy.\n'
from oci-python-sdk.
resolved
from oci-python-sdk.
Related Issues (20)
- Private IP addresses for the db_nodes in ExaCS is not the correct one HOT 21
- problems running in CLI OCI HOT 3
- metrics are geting 429 error when we calling the api filter maximum , minimum and average metrics HOT 6
- Issue with accessing oci.container_instances.ContainerInstanceClient response data HOT 2
- volume backups are not getting all records in this list_volume_backups api call HOT 8
- Report with properties of PDBs HOT 4
- Error using FlowLogCaptureFilterRuleDetails
- Missing dependency on sseclient
- oci python SDK while using instance-principals, raising exceptions.ServiceError NotAuthorizedOrNotFound HOT 7
- a little typo in the documentation how to run CLI with help option $ python3 oci_capacity_reporter_gui.py -help HOT 1
- Error in log-analytics storage purge-storage-data HOT 4
- Focus report how we can get it. HOT 1
- call mysql_client_composite_ops.copy_backup_and_wait_for_state display AttributeError: 'DbBackupsClient' object has no attribute 'get_work_request'
- usageapi not working for ap-mumbai region HOT 8
- update python cryptography dependency again (42 -> 43)
- muscat region instance not reachable with the api_config parameters from python script. HOT 7
- Date for adding `response_format` from cohere api HOT 2
- Optimizer client api givinig wrong data(list resource action api) HOT 8
- ShowSubscription - 401 - Not Authorized HOT 14
- implementation of price calculator in application HOT 1
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from oci-python-sdk.