'Indicates is a machine is currently shutting down.'

def is_shutting_down(self):

    try:
        runlevel = int(self.run('runlevel').stdout.strip().split()[1])
        return (runlevel in (0, 6))
    except Exception:
        return False
