def clean_zeppelin():
    try:
        conn.sudo('systemctl stop zeppelin-notebook')
        conn.sudo('rm -rf /opt/zeppelin* /var/log/zeppelin /var/run/zeppelin')
        if (os.environ['notebook_multiple_clusters'] == 'true'):
            conn.sudo('systemctl stop livy-server')
            conn.sudo('rm -rf /opt/livy* /var/run/livy')
            conn.sudo('rm -f /etc/systemd/system/livy-server.service')
        conn.sudo('rm -f /etc/systemd/system/zeppelin-notebook.service')
        conn.sudo('systemctl daemon-reload')
    except Exception as err:
        print('Error: {0}'.format(err))
        sys.exit(1)
def clean_zeppelin():
    try:
        conn.sudo('systemctl stop zeppelin-notebook')
        conn.sudo('rm -rf /opt/zeppelin* /var/log/zeppelin /var/run/zeppelin')
        if (os.environ['notebook_multiple_clusters'] == 'true'):
            conn.sudo('systemctl stop livy-server')
            conn.sudo('rm -rf /opt/livy* /var/run/livy')
            conn.sudo('rm -f /etc/systemd/system/livy-server.service')
        conn.sudo('rm -f /etc/systemd/system/zeppelin-notebook.service')
        conn.sudo('systemctl daemon-reload')
    except Exception as err:
        print('Error: {0}'.format(err))
        sys.exit(1)