puppetlabs/razor-server — pull request #95 by ChrisPortman (2013-11-15 00:45:49+00:00)
Title: Add a delete-policy command

Adding a command to delete policies.
razor delete-policy --name

Database:
Added a 'bound' field to the nodes table. This will be the authoritative indicator as to whether or not a node is bound. Nodes can be bound without a policy (although they still need a policy to apply at some point to become bound)

Behaviour:
- Deleting a policy will:
> Disassociate any tags from the policy
> Disassociate any nodes from the policy
> Destroy the policy.

- Booting a node:
> If the node is bound and has a policy, the installer from the policy will dictate the boot action.
> If the node is bound but has no policy (it has been deleted), the noop installer will be applied, forcing a local boot.
> If the node is not bound (bound = false) boot the micro kernel and wait for a policy.

Views:
- nodes:
> Now shows the IP and hostname in the nodes list.

- nodes :
> Shows the value of bound (True | False) if the policy is not set, shows a message for policy stating that the policy has been deleted of changed such that no longer matches (future).

Disclaimer: My ruby skills are about 2 weeks old (torqueBox/rack/sequel, about 2 days old). All the above works in my testing, but someone with better ruby knowledge should sanity check it. Specifically the file db/migrate/002_create_base_schema.rb, im not sure how to test this....

Thanks,
Chris