mirror of
https://github.com/FreeRTOS/FreeRTOS.git
synced 2026-08-05 20:53:50 +00:00
LTS development changes have Source, Demo, and dependencies added for FreeRTOS-IoT-Libraries. These libraries are using FreeRTOS kernel, FreeRTOS-Plus-TCP, and FreeRTOS-Plus-Trace of V10.3.0 tag. FreeRTOS_Plus_TCP and FreeRTOS_Plus_Trace are as used as is, but a few changes are made to FreeRTOS as listed below.
Removed FreeRTOS/Demo.
Updated FreeRTOS/readme.txt to remove mentions about the demos.
Removed FreeRTOS/links_to_doc_pages_for_the_demo_projects.url file as there are no demos present.
28 lines
767 B
Python
Executable File
28 lines
767 B
Python
Executable File
#!/usr/bin/env python
|
|
|
|
import boto3
|
|
import json
|
|
|
|
|
|
class Policy():
|
|
def __init__(self, name, policy=''):
|
|
self.name = name
|
|
self.policy = policy
|
|
self.client = boto3.client('iot')
|
|
|
|
def create(self):
|
|
assert not self.exists(), "Policy already exists"
|
|
self.client.create_policy(policyName=self.name,
|
|
policyDocument=self.policy)
|
|
|
|
def delete(self):
|
|
assert self.exists(), "Policy does not exist, cannot be deleted"
|
|
self.client.delete_policy(policyName=self.name)
|
|
|
|
def exists(self):
|
|
policies = self.client.list_policies()['policies']
|
|
for policy in policies:
|
|
if self.name == policy['policyName']:
|
|
return True
|
|
return False
|