def joyent_node_state(id_): ''' Convert joyent returned state to state common to other data center return values for consistency :param id_: joyent state value :return: state value ''' states = {'running': 0, 'stopped': 2, 'stopping': 2, 'provisioning': 3, 'deleted': 2, 'unknown': 4} if id_ not in states: id_ = 'unknown' return node_state(states[id_])
def joyent_node_state(id_): """ Convert joyent returned state to state common to other data center return values for consistency :param id_: joyent state value :return: state value """ states = { "running": 0, "stopped": 2, "stopping": 2, "provisioning": 3, "deleted": 2, "unknown": 4, } if id_ not in states: id_ = "unknown" return node_state(states[id_])
def test_node_state_libcloud_100(self): state = libcloud.node_state('terminated') self.assertEqual('TERMINATED', state)
def test_node_state_libcloud_020(self): state = libcloud.node_state(2) self.assertEqual('TERMINATED', state)
def test_node_state_libcloud_100(self): state = libcloud.node_state("terminated") self.assertEqual("TERMINATED", state)