This prevents issues when the user hasn't provided the appropriate attributes for a preallocated host.
Details
Details
- Reviewers
epriestley - Group Reviewers
Blessed Reviewers - Maniphest Tasks
- T1049: Implement Harbormaster
- Commits
- Restricted Diffusion Commit
rP1f53017f1f46: Validate resource attributes for preallocated hosts before executing leases
Attempted to lease against a resource with omitted attributes, got an exception thrown before any SSH commands occurred.
Diff Detail
Diff Detail
- Lint
Lint Skipped - Unit
Tests Skipped
Event Timeline
Comment Actions
Hmm, this might be a little cleaner and more powerful?
PhutilTypeSpec::checkMap(
$this->getAttributes('platform', 'host', 'port', 'user', 'path'),
array(
'platform' => 'required string',
'host' => 'required string',
'port' => 'required int',
'user' => 'required string',
'path' => 'required string',
));Then write getAttributes() as:
return array_select_keys($this->attributes, $attribute_names);