def joyent_node_state(id_):
    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_])
Convert joyent returned state to state common to other data center return
dataset/ETHPy150Open saltstack/salt/salt/cloud/clouds/joyent.py/joyent_node_state