comanage-users - Re: [comanage-users] Problem creating new provisioner plugin
Subject: COmanage Users List
List archive
- From: Benn Oshrin <>
- To: Duncan Brown <>
- Cc:
- Subject: Re: [comanage-users] Problem creating new provisioner plugin
- Date: Sun, 17 Nov 2019 05:13:19 -0500
Hi Duncan,
If I had to guess blindly (ie: without actually trying to run the code), I think it's because the filename for your model is wrong:
Model/CoRestDccProvisonerTarget.php
should be
Model/CoRestDccProvisionerTarget.php
(Note the missing "I" in "Provisioner".)
Most likely, the framework is failing to find your Model, and then it "helpfully" autocreates a blank model, which is why things like $actsAs and $belongsTo are empty.
Thanks,
-Benn-
On 11/17/19 8:41 PM, Duncan Brown wrote:
Hi all,
I'm trying to create a new provisioner plugin, starting from the
GitHubProvisioner as a base, but I can't get past the following error when
trying to configure the plugin:
comanage-registry_comanage-registry.1.dkcvymquud9x@docker-desktop |
2019-11-17 01:22:24 Error: [InvalidArgumentException] No CO Specified
comanage-registry_comanage-registry.1.dkcvymquud9x@docker-desktop |
Request URL:
/registry/rest_dcc_provisioner/co_rest_dcc_provisioner_targets/edit/8
comanage-registry_comanage-registry.1.dkcvymquud9x@docker-desktop | Stack
Trace:
comanage-registry_comanage-registry.1.dkcvymquud9x@docker-desktop | #0
/srv/comanage-registry/app/Controller/SPTController.php(46):
AppController->beforeFilter()
It looks like calculateImpliedCoId is failing to get the CO Id. For some
reason, my new plugin's model seems incomplete. A dump of the model shows
that it's missing actsAs, belongsTo, validate, etc. but I can't figure out
why:
{"useDbConfig":"default","useTable":"co_rest_dcc_provisioner_targets","id":null,"data":[],"schemaName":null,"table":"co_rest_dcc_provisioner_targets","primaryKey":"id","validate":[],"validationErrors":[],"validationDomain":null,"plugin":"RestDccProvisioner","name":"CoRestDccProvisionerTarget","alias":"CoRestDccProvisionerTarget","tableToModel":{"co_rest_dcc_provisioner_targets":"CoRestDccProvisionerTarget"},"cacheQueries":false,"belongsTo":[],"hasOne":[],"hasMany":[],"hasAndBelongsToMany":[],"actsAs":null,"Behaviors":{"modelName":"CoRestDccProvisionerTarget","defaultPriority":10},"whitelist":[],"cacheSources":true,"findQueryType":null,"recursive":1,"order":null,"virtualFields":[],"__backAssociation":[],"__backInnerAssociation":[],"__backOriginalAssociation":[],"__backContainableAssociation":[],"__safeUpdateMode":false,"useConsistentAfterFind":true,"findMethods":{"all":true,"first":true,"count":true,"neighbors":true,"list":true,"threaded":true}}
Compared to the GitHubProvisioner:
{"name":"CoGithubProvisionerTarget","actsAs":["Containable"],"belongsTo":{"CoProvisioningTarget":{"className":"CoProvisioningTarget","foreignKey":"co_provisioning_target_id","conditions":"","fields":"","order":"","counterCache":""}},"displayField":"github_user","validate":{"co_provisioning_target_id":{"rule":"numeric","required":true,"message":"A CO Provisioning Target ID must be
provided"},"github_user":{"rule":"notBlank"},"github_org":{"rule":["maxlength",80]},"client_id":{"rule":"notBlank"},"client_secret":{"rule":"notBlank"},"access_token":{"rule":["maxlength",80]},"provision_group_members":{"rule":"boolean"},"remove_unknown_members":{"rule":"boolean"},"provision_ssh_keys":{"rule":"boolean"}},"useDbConfig":"default","useTable":"co_github_provisioner_targets","id":null,"data":[],"schemaName":null,"table":"co_github_provisioner_targets","primaryKey":"id","validationErrors":[],"validationDomain":null,"plugin":"GithubProvisioner","alias":"CoGithubProvisionerTarget","tableToModel":{"co_github_provisioner_targets":"CoGithubProvisionerTarget"},"cacheQueries":false,"hasOne":[],"hasMany":[],"hasAndBelongsToMany":[],"Behaviors":{"modelName":"CoGithubProvisionerTarget","defaultPriority":10},"whitelist":[],"cacheSources":true,"findQueryType":null,"recursive":1,"order":null,"virtualFields":[],"__backAssociation":[],"__backInnerAssociation":[],"__backOriginalAssociation":[],"__backContainableAssociation":[],"__safeUpdateMode":false,"useConsistentAfterFind":true,"findMethods":{"all":true,"first":true,"count":true,"neighbors":true,"list":true,"threaded":true}}
The code for my model sets the actsAs, belongsTo, validate:
<https://github.com/duncan-brown/comanage-registry/blob/dcc-provisioner/app/AvailablePlugin/RestDccProvisioner/Model/CoRestDccProvisonerTarget.php>
So I'm not sure what I've messed up. Any suggestions are appreciated.
Cheers,
Duncan.
- [comanage-users] Problem creating new provisioner plugin, Duncan Brown, 11/17/2019
- Re: [comanage-users] Problem creating new provisioner plugin, Benn Oshrin, 11/17/2019
- Re: [comanage-users] Problem creating new provisioner plugin, Duncan Brown, 11/17/2019
- Re: [comanage-users] Problem creating new provisioner plugin, Benn Oshrin, 11/17/2019
Archive powered by MHonArc 2.6.19.