def run(self, argv):
        
        _root = get_playbook_root(os.getcwd())
        _role = os.path.join(_root, 'roles', argv.role)
        
        if not os.path.exists(_role):
            print "error :: the role `%s` does not exist in the playbook's library" % _role
            return 1

        if not os.path.islink(_role):
            print "error :: the role `%s` was not installed using ARM. refusing to delete." % _role
            return 1

        _library = os.path.join(os.path.realpath(_role))
        
        repo = Repo(_library)
        
        # check to see if the role in the library has non-committed changes
        if repo.git.status(porcelain=True).strip() != '':
            print "error :: the role `%s` has non-commited changes" % _role
            return 1

        # check to see if the library role has non-pushed changes
        # http://stackoverflow.com/questions/3844801
        def checkEqual(lst):
            return not lst or lst.count(lst[0]) == len(lst)
        
        if not checkEqual([ ref.commit for ref in repo.refs ] ):
            print "error :: the role `%s` has commits different from the origin"
            return 1
        
        for root, dir, files in os.walk(_library):
            if '.git' in root:
                continue
            for f in files:
                print "%s/%s" % (root, f)
                
        if query_true_false('Are you sure you want to remove `%s`?' % argv.role, default=True):
            os.unlink(_role)
            shutil.rmtree(_library)
        else:
            print "exiting"
dataset/ETHPy150Open mirskytech/ansible-role-manager/arm/commands/uninstall.py/uninstall.run/original