Skip to content

Commit

Permalink
Merge pull request #322 from Mirantis/add-help-messages
Browse files Browse the repository at this point in the history
Add help messages to the engine parameter schemes
  • Loading branch information
naumvd95 authored Jun 26, 2018
2 parents 91d0e3d + f33b4c2 commit 7d35e38
Show file tree
Hide file tree
Showing 4 changed files with 19 additions and 13 deletions.
4 changes: 2 additions & 2 deletions kqueen/blueprints/api/generic_views.py
Original file line number Diff line number Diff line change
Expand Up @@ -139,8 +139,8 @@ def dispatch_request(self, *args, **kwargs):

try:
self.obj.delete()
except Exception:
abort(500)
except Exception as e:
abort(500, "Failed to delete object: {}".format(repr(e)))

return jsonify({'id': self.obj.id, 'state': 'deleted'})

Expand Down
22 changes: 13 additions & 9 deletions kqueen/engines/gce.py
Original file line number Diff line number Diff line change
Expand Up @@ -61,7 +61,10 @@ class GceEngine(BaseEngine):
'required': True,
'min': 1,
'number': True
}
},
'help_message':
'To enable network policy, your cluster must have at least 2 nodes. The recommended minimum '
'cluster size to run the network policy enforcement is 3 Standard-1 instances'
},
'zone': {
'type': 'select',
Expand Down Expand Up @@ -92,13 +95,13 @@ class GceEngine(BaseEngine):
'label': 'Machine Type',
'order': 3,
'choices': [
('n1-standard-1', 'Standart: 1 vCPU, 3.75 GB RAM'),
('n1-standard-2', 'Standart: 2 vCPU, 7.5 GB RAM'),
('n1-standard-4', 'Standart: 4 vCPU, 15 GB RAM'),
('n1-standard-8', 'Standart: 8 vCPU, 30 GB RAM'),
('n1-standard-16', 'Standart: 16 vCPU, 60 GB RAM'),
('n1-standard-32', 'Standart: 32 vCPU, 120 GB RAM'),
('n1-standard-64', 'Standart: 64 vCPU, 240 GB RAM')
('n1-standard-1', 'Standard: 1 vCPU, 3.75 GB RAM'),
('n1-standard-2', 'Standard: 2 vCPU, 7.5 GB RAM'),
('n1-standard-4', 'Standard: 4 vCPU, 15 GB RAM'),
('n1-standard-8', 'Standard: 8 vCPU, 30 GB RAM'),
('n1-standard-16', 'Standard: 16 vCPU, 60 GB RAM'),
('n1-standard-32', 'Standard: 32 vCPU, 120 GB RAM'),
('n1-standard-64', 'Standard: 64 vCPU, 240 GB RAM')
],
'validators': {
'required': True
Expand All @@ -112,7 +115,8 @@ class GceEngine(BaseEngine):
'validators': {
'required': False,
'cidr': True
}
},
'help_message': 'Provide a unique IP range or leave it empty for auto-assignment'
},
'network_policy': {
'type': 'select',
Expand Down
3 changes: 2 additions & 1 deletion kqueen/engines/jenkins.py
Original file line number Diff line number Diff line change
Expand Up @@ -56,7 +56,8 @@ class JenkinsEngine(BaseEngine):
'order': 2,
'validators': {
'required': False
}
},
'help_message': 'Overrides the existing parameters of the Jenkins job'
}
}
}
Expand Down
3 changes: 2 additions & 1 deletion kqueen/engines/manual.py
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,8 @@ class ManualEngine(BaseEngine):
'apiVersion',
'kind'
]
}
},
'help_message': 'Only "username" and "password" are supported for the user description.'
}
}
}
Expand Down

0 comments on commit 7d35e38

Please sign in to comment.