def configure(): """Configure node using existing config file""" # Check that a node has been selected if not env.host_string: msg = 'no node specified\n' msg += 'Usage:\n cook node:MYNODE configure' msg += '\n cook node:all configure' abort(msg) lib.print_header("Configuring {0}".format(env.host_string)) # Read node data and configure node node = lib.get_node(env.host_string) chef.sync_node(node)
def test_build_node(self): """Should build cookbooks dependencies""" env.host_string = 'testnode' cookbooks = chef._build_node(lib.get_node(env.host_string)) self.assertEquals(cookbooks, ['subversion'])
def test_get_node(self): """Should get data for a given node, empty when it doesn't exist""" expected = {'run_list': []} self.assertEquals(lib.get_node('Idon"texist'), expected) expected = {'run_list': ['recipe[subversion]']} self.assertEquals(lib.get_node('testnode'), expected)