crowbar/barclamp-network — pull request #126 by cloudedge (2013-02-09 20:25:59+00:00)
Title: Role HasNode via AttribInstance (death to NodeRole) [2/2]

This is the next-to-last major refactoring pull request!

In this pull, I have eliminated the NodeRole habtm table in favor of joining
through the AttribInstance table. This has the benefit of being simpler
and automatically managed by the BarclampInstance clone process.

The relationship has it's own class: AttribInstanceHasNode that provides
the needed filtering and relationship aspects to Node and RoleInstance.

Part of the needed behavior was to have make the RoleInstance required
for the AttribInstance model. This required the addition of the "user_defined"
role for the Crowbar model. If an attrib is created without a role then
crowbar will automatically use that role.

Eventually (not NOT implemented) this relationship could carry extra data via
the AttribInstance actual/request state information.

This change finally broke most of the hold Proposal logic so that was also
removed.

The next step is to add the BarclampConfiguration work including the CLI
and API for managing BarclampConfigurations. This will likely require
adding the concept of "active" vs "inactive" instances.

NOTE: There are some minor tweaks needed to address breaking or changed tests.

crowbar_framework/app/models/bond.rb | 4 ++--
crowbar_framework/test/unit/bond_model_test.rb | 9 +++++++--
2 files changed, 9 insertions(+), 4 deletions(-)

Crowbar-Pull-ID: c0d9a908fdcf7a23f9302ab74173401a4f2e679b

Crowbar-Release: development