Skip to content
This repository has been archived by the owner on Apr 22, 2024. It is now read-only.

Commit

Permalink
fix: change projectschema -> schema decorator in asset generators
Browse files Browse the repository at this point in the history
  • Loading branch information
Shawn Sarwar committed Jun 6, 2019
1 parent 0a23020 commit 3861663
Show file tree
Hide file tree
Showing 2 changed files with 11 additions and 11 deletions.
10 changes: 5 additions & 5 deletions assets/generation/mocker.py
Original file line number Diff line number Diff line change
Expand Up @@ -394,7 +394,7 @@ def __init__(self, kernel_url, user, pw):
self.types = {}
self.alias = {}
self.names = {}
self.project_schema = {}
self.schema_decorator = {}
self.schema_id = {}
self.type_count = {}
signal.signal(signal.SIGTERM, self.kill)
Expand Down Expand Up @@ -431,7 +431,7 @@ def register(self, name, payload=None):
payload = self.types[name].get()
type_name = self.alias.get(name)
type_id = self.schema_id.get(name)
ps_id = self.project_schema.get(type_id)
ps_id = self.schema_decorator.get(type_id)
data = self.payload_to_data(ps_id, payload)
try:
res = self.client.entities.create(data=data)
Expand Down Expand Up @@ -482,8 +482,8 @@ def load(self):
self.schema_id[full_name] = _id
self.schema_id[_id] = name

for ps in self.client.projectschemas.paginated('list'):
for ps in self.client.schemadecorators.paginated('list'):
schema_id = ps.schema
_id = ps.id
self.project_schema[schema_id] = _id
self.project_schema[_id] = schema_id
self.schema_decorator[schema_id] = _id
self.schema_decorator[_id] = schema_id
12 changes: 6 additions & 6 deletions assets/generation/register.py
Original file line number Diff line number Diff line change
Expand Up @@ -74,10 +74,10 @@ def schema():
return out


def project_schema(project, ids):
def schema_decorator(project, ids):
out = {}
for name in ids.keys():
project_schema_obj = {
schema_decorator_obj = {
"revision": "1",
"name": name,
"schema": ids[name],
Expand All @@ -86,7 +86,7 @@ def project_schema(project, ids):
"transport_rule": "[]",
"mandatory_fields": "[]"
}
out[name] = client.projectschemas.create(data=project_schema_obj)
out[name] = client.schemadecorators.create(data=schema_decorator_obj)
return out

def mappingset(project):
Expand Down Expand Up @@ -117,9 +117,9 @@ def register():
pprint(schema_info)
schema_ids = {obj.name : obj.id for obj in schema_info}
pprint(schema_ids)
project_schemas = project_schema(project_id, schema_ids)
pprint(project_schemas)
ps_ids = {ps.name : ps.id for ps in project_schemas.values()}
schema_decorators = schema_decorator(project_id, schema_ids)
pprint(schema_decorators)
ps_ids = {ps.name : ps.id for ps in schema_decorators.values()}
ms = mappingset(project_id)
sub_id = mapping(project_id, ms.id, ps_ids)
pprint(sub_id)
Expand Down

0 comments on commit 3861663

Please sign in to comment.