make firstname and lastname not required; remove the tosca default for bool fields in user obj
diff --git a/xos/tosca/custom_types/xos.m4 b/xos/tosca/custom_types/xos.m4
index a4b1b05..5b2a5ab 100644
--- a/xos/tosca/custom_types/xos.m4
+++ b/xos/tosca/custom_types/xos.m4
@@ -385,16 +385,17 @@
type: tosca.capabilities.xos.User
properties:
+ xos_base_props
password:
type: string
required: false
firstname:
type: string
- required: true
+ required: false
description: First name of User.
lastname:
type: string
- required: true
+ required: false
description: Last name of User.
phone:
type: string
@@ -410,11 +411,13 @@
description: Public key that will be installed in Instances.
is_active:
type: boolean
- default: true
+ required: false
+ #default: true
description: If True, the user may log in.
is_admin:
type: boolean
- default: false
+ required: false
+ #default: false
description: If True, the user has root admin privileges.
login_page:
type: string
@@ -428,6 +431,9 @@
An XOS network parameter type. May be applied to Networks and/or
Ports.
+ properties:
+ xos_base_props
+
capabilities:
network_parameter_type:
type: tosca.capabilities.xos.NetworkParameterType
@@ -444,6 +450,7 @@
type: tosca.capabilities.xos.NetworkTemplate
properties:
+ xos_base_props
visibility:
type: string
default: private
diff --git a/xos/tosca/custom_types/xos.yaml b/xos/tosca/custom_types/xos.yaml
index 8c15379..6b76fae 100644
--- a/xos/tosca/custom_types/xos.yaml
+++ b/xos/tosca/custom_types/xos.yaml
@@ -730,16 +730,28 @@
type: tosca.capabilities.xos.User
properties:
+ no-delete:
+ type: boolean
+ default: false
+ description: Do not allow Tosca to delete this object
+ no-create:
+ type: boolean
+ default: false
+ description: Do not allow Tosca to create this object
+ no-update:
+ type: boolean
+ default: false
+ description: Do not allow Tosca to update this object
password:
type: string
required: false
firstname:
type: string
- required: true
+ required: false
description: First name of User.
lastname:
type: string
- required: true
+ required: false
description: Last name of User.
phone:
type: string
@@ -755,11 +767,13 @@
description: Public key that will be installed in Instances.
is_active:
type: boolean
- default: true
+ required: false
+ #default: true
description: If True, the user may log in.
is_admin:
type: boolean
- default: false
+ required: false
+ #default: false
description: If True, the user has root admin privileges.
login_page:
type: string
@@ -773,6 +787,20 @@
An XOS network parameter type. May be applied to Networks and/or
Ports.
+ properties:
+ no-delete:
+ type: boolean
+ default: false
+ description: Do not allow Tosca to delete this object
+ no-create:
+ type: boolean
+ default: false
+ description: Do not allow Tosca to create this object
+ no-update:
+ type: boolean
+ default: false
+ description: Do not allow Tosca to update this object
+
capabilities:
network_parameter_type:
type: tosca.capabilities.xos.NetworkParameterType
@@ -789,6 +817,18 @@
type: tosca.capabilities.xos.NetworkTemplate
properties:
+ no-delete:
+ type: boolean
+ default: false
+ description: Do not allow Tosca to delete this object
+ no-create:
+ type: boolean
+ default: false
+ description: Do not allow Tosca to create this object
+ no-update:
+ type: boolean
+ default: false
+ description: Do not allow Tosca to update this object
visibility:
type: string
default: private
diff --git a/xos/tosca/resources/user.py b/xos/tosca/resources/user.py
index 79b2e71..55c0423 100644
--- a/xos/tosca/resources/user.py
+++ b/xos/tosca/resources/user.py
@@ -66,6 +66,8 @@
if not xos_args.get("site",None):
raise Exception("Site name must be specified when creating user")
+ if ("firstname" not in xos_args) or ("lastname" not in xos_args):
+ raise Exception("firstname and lastname must be specified when creating user")
user = User(**xos_args)
user.save()