crowbar/barclamp-crowbar — pull request #365 by cloudedge (2013-01-30 03:41:05+00:00)
Title: Refactor NodeAttrib to be AttribInstance instead [1/2]

This changes was taken because we have a neeed to subclass
attributes in a consistent and predictable way within barclamps.

The previous model (still partially implemented in BarclampAttribs)
was trying to split attribute data into node and barclamp types.

That approach is confusing and difficult to subclass consistently.

In the new model (see the doc/devguide/model directory) only have one
place where attrib data is expected.

This allows us to store attrib data for each node AND also for
the barclamp instance too (when node=0 then the data is barclamp instance data).

The next step in the process is to move the BarclampAttrib class into
AttribInstance. That should be easier because it is less used.

Added function notes:
* There is a small commit in the middle in which I added some
BDD debugging help. This commit allows users to add tags to logs.
* The Proposal Tests were failing - I've removed them while we refactor

BDD/attrib_instance.erl | 59 ++
BDD/bdd.erl | 3 +
BDD/bdd_utils.erl | 14 +-
BDD/default.config | 1 +
BDD/dev.erl | 2 +-
BDD/features/barclamp_api.feature | 21 -
BDD/features/node.feature | 2 +-
BDD/features/scaffolds.feature | 2 +-
BDD/features/support.feature | 4 +
BDD/node.erl | 30 +-
BDD/node_attrib.erl | 59 --
.../app/controllers/crowbar_controller.rb | 14 +-
.../app/controllers/nodes_controller.rb | 2 +-
.../app/controllers/support_controller.rb | 8 +-
crowbar_framework/app/models/attrib.rb | 8 +-
crowbar_framework/app/models/attrib_instance.rb | 113 +++
.../app/models/crowbar/attrib_instance_default.rb | 31 +-
crowbar_framework/app/models/jig_run.rb | 4 +-
crowbar_framework/app/models/node.rb | 33 +-
crowbar_framework/app/models/node_attrib.rb | 154 ----
crowbar_framework/config/routes.rb | 1 +
.../20120731225600_create_attrib_instances.rb | 30 +
.../migrate/20120731225600_create_node_attribs.rb | 35 -
crowbar_framework/lib/api_helper.rb | 11 +-
crowbar_framework/public/doc/crowbar/logo-dell.jpg | Bin 4340 -> 0 bytes
.../public/doc/crowbar/logo-opscode.png | Bin 5320 -> 0 bytes
.../public/doc/crowbar/user-barclamp-list.png | Bin 3684 -> 0 bytes
.../public/doc/crowbar/user-bulk-edit.png | Bin 3626 -> 0 bytes
.../public/doc/crowbar/user-dashboard.png | Bin 5945 -> 0 bytes
.../public/doc/crowbar/user-general-layout.png | Bin 4416 -> 0 bytes
.../public/doc/crowbar/user-network-intfs.png | Bin 7053 -> 0 bytes
.../public/doc/crowbar/user-network-switch.png | Bin 12068 -> 0 bytes
.../public/doc/crowbar/user-network-vlan.png | Bin 7064 -> 0 bytes
.../public/doc/crowbar/user-proposal-edit.png | Bin 5554 -> 0 bytes
.../public/doc/crowbar/user-proposal-workflow.png | Bin 35674 -> 0 bytes
.../public/doc/crowbar/user-utils-export.png | Bin 6356 -> 0 bytes
crowbar_framework/spec/models/jig_spec.rb | 6 +-
.../spec/models/proposal_queue_item_spec.old | 21 +
.../spec/models/proposal_queue_item_spec.rb | 21 -
.../spec/models/proposal_queue_spec.old | 737 ++++++++++++++++++++
.../spec/models/proposal_queue_spec.rb | 737 --------------------
.../spec/models/service_object_spec.old | 136 ++++
.../spec/models/service_object_spec.rb | 136 ----
.../test/unit/attrib_instance_model_test.rb | 282 ++++++++
.../test/unit/node_attrib_model_test.rb | 317 ---------
crowbar_framework/test/unit/node_model_test.rb | 2 +-
.../test/unit/proposal_config_model_test.old | 338 +++++++++
.../test/unit/proposal_config_model_test.rb | 338 ---------
.../test/unit/proposal_model_test.old | 51 ++
crowbar_framework/test/unit/proposal_model_test.rb | 51 --
doc/devguide/model/crowbar_model.dia | Bin 3137 -> 3367 bytes
doc/devguide/model/crowbar_model.png | Bin 27024 -> 27430 bytes
doc/devguide/testing/bdd/internals/config.md | 7 +
doc/userguide/logo-dell.jpg | Bin 0 -> 4340 bytes
doc/userguide/logo-opscode.png | Bin 0 -> 5320 bytes
doc/userguide/user-barclamp-list.png | Bin 0 -> 3684 bytes
doc/userguide/user-bulk-edit.png | Bin 0 -> 3626 bytes
doc/userguide/user-dashboard.png | Bin 0 -> 5945 bytes
doc/userguide/user-general-layout.png | Bin 0 -> 4416 bytes
doc/userguide/user-network-intfs.png | Bin 0 -> 7053 bytes
doc/userguide/user-network-switch.png | Bin 0 -> 12068 bytes
doc/userguide/user-network-vlan.png | Bin 0 -> 7064 bytes
doc/userguide/user-proposal-edit.png | Bin 0 -> 5554 bytes
doc/userguide/user-proposal-workflow.png | Bin 0 -> 35674 bytes
doc/userguide/user-utils-export.png | Bin 0 -> 6356 bytes
doc/userguide/utils/logmarker.md | 15 +
66 files changed, 1882 insertions(+), 1954 deletions(-)

Crowbar-Pull-ID: 88c48f4ee579087c974bd5cf1813c795e8781470

Crowbar-Release: development