import requests


def create_uninstall_task(package_name):
    """Issues an iControl LX uninstall task"""
    install_url = 'http://localhost:8100/mgmt/shared/iapp/package-management-tasks'
    install_json = '{ "operation": "UNINSTALL", "packageName": "%s" }' % package_name
    response = requests.post(install_url,
                             auth=('admin', ''),
                             data=install_json)
    if response.status_code < 400:
        response_json = response.json()
        return response_json['id']
    return False