Fix bugs around userdata
This commit is contained in:
parent
e5d38ec6bd
commit
1c12a4c2f9
|
@ -5,11 +5,11 @@ create table network_template (id SERIAL PRIMARY KEY, name TEXT NOT NULL UNIQUE,
|
||||||
create table network (id SERIAL PRIMARY KEY, network_template INT REFERENCES network_template(id), vni INT NOT NULL);
|
create table network (id SERIAL PRIMARY KEY, network_template INT REFERENCES network_template(id), vni INT NOT NULL);
|
||||||
create table storage_template (id SERIAL PRIMARY KEY, name TEXT NOT NULL UNIQUE);
|
create table storage_template (id SERIAL PRIMARY KEY, name TEXT NOT NULL UNIQUE);
|
||||||
create table storage (id SERIAL PRIMARY KEY, storage_template INT REFERENCES storage_template(id), pool TEXT NOT NULL, disk_id TEXT NOT NULL, disk_size_gb INT NOT NULL, mountpoint TEXT, filesystem TEXT, filesystem_args TEXT);
|
create table storage (id SERIAL PRIMARY KEY, storage_template INT REFERENCES storage_template(id), pool TEXT NOT NULL, disk_id TEXT NOT NULL, disk_size_gb INT NOT NULL, mountpoint TEXT, filesystem TEXT, filesystem_args TEXT);
|
||||||
create table userdata_template (id SERIAL PRIMARY KEY, name TEXT NOT NULL UNIQUE, userdata TEXT NOT NULL);
|
create table userdata (id SERIAL PRIMARY KEY, name TEXT NOT NULL UNIQUE, userdata TEXT NOT NULL);
|
||||||
create table script (id SERIAL PRIMARY KEY, name TEXT NOT NULL UNIQUE, script TEXT NOT NULL);
|
create table script (id SERIAL PRIMARY KEY, name TEXT NOT NULL UNIQUE, script TEXT NOT NULL);
|
||||||
create table profile (id SERIAL PRIMARY KEY, name TEXT NOT NULL UNIQUE, system_template INT REFERENCES system_template(id), network_template INT REFERENCES network_template(id), storage_template INT REFERENCES storage_template(id), userdata_template INT REFERENCES userdata_template(id), script INT REFERENCES script(id), arguments text);
|
create table profile (id SERIAL PRIMARY KEY, name TEXT NOT NULL UNIQUE, system_template INT REFERENCES system_template(id), network_template INT REFERENCES network_template(id), storage_template INT REFERENCES storage_template(id), userdata_template INT REFERENCES userdata_template(id), script INT REFERENCES script(id), arguments text);
|
||||||
grant all privileges on database pvcprov to pvcprov;
|
grant all privileges on database pvcprov to pvcprov;
|
||||||
grant all privileges on all tables in schema public to pvcprov;
|
grant all privileges on all tables in schema public to pvcprov;
|
||||||
grant all privileges on all sequences in schema public to pvcprov;
|
grant all privileges on all sequences in schema public to pvcprov;
|
||||||
|
|
||||||
insert into userdata_template(name, userdata) values ('empty', '');
|
insert into userdata(name, userdata) values ('empty', '');
|
||||||
|
|
|
@ -4582,7 +4582,7 @@ class API_Provisioner_Userdata_Root(Resource):
|
||||||
items:
|
items:
|
||||||
$ref: '#/definitions/userdata'
|
$ref: '#/definitions/userdata'
|
||||||
"""
|
"""
|
||||||
return api_provisioner.list_template_userdata(
|
return api_provisioner.list_userdata(
|
||||||
reqargs.get('limit', None)
|
reqargs.get('limit', None)
|
||||||
)
|
)
|
||||||
|
|
||||||
|
@ -4647,7 +4647,7 @@ class API_Provisioner_Userdata_Element(Resource):
|
||||||
id: Message
|
id: Message
|
||||||
"""
|
"""
|
||||||
return api_provisioner.list_userdata(
|
return api_provisioner.list_userdata(
|
||||||
template,
|
userdata,
|
||||||
is_fuzzy=False
|
is_fuzzy=False
|
||||||
)
|
)
|
||||||
|
|
||||||
|
@ -4688,7 +4688,7 @@ class API_Provisioner_Userdata_Element(Resource):
|
||||||
{ 'name': 'data', 'required': True, 'helpmsg': "A userdata document must be specified" }
|
{ 'name': 'data', 'required': True, 'helpmsg': "A userdata document must be specified" }
|
||||||
])
|
])
|
||||||
@Authenticator
|
@Authenticator
|
||||||
def put(self, template):
|
def put(self, userdata, reqargs):
|
||||||
"""
|
"""
|
||||||
Update userdata document {userdata}
|
Update userdata document {userdata}
|
||||||
---
|
---
|
||||||
|
@ -4718,7 +4718,7 @@ class API_Provisioner_Userdata_Element(Resource):
|
||||||
)
|
)
|
||||||
|
|
||||||
@Authenticator
|
@Authenticator
|
||||||
def delete(self, template):
|
def delete(self, userdata):
|
||||||
"""
|
"""
|
||||||
Remove userdata document {userdata}
|
Remove userdata document {userdata}
|
||||||
---
|
---
|
||||||
|
|
Loading…
Reference in New Issue