'Associate/Disassociate Network with Project and/or Host
arguments: network project host
leave any field blank to ignore it'

@validate_network_plugin
@args('--fixed_range', metavar='<x.x.x.x/yy>', help='Network    to    modify')
@args('--project', metavar='<project    name>', help='Project    name    to    associate')
@args('--host', metavar='<host>', help='Host    to    associate')
@args('--disassociate-project', action='store_true', dest='dis_project', default=False, help='Disassociate    Network    from    Project')
@args('--disassociate-host', action='store_true', dest='dis_host', default=False, help='Disassociate    Host    from    Project')
def modify(self, fixed_range, project=None, host=None, dis_project=None, dis_host=None):

    admin_context = context.get_admin_context()
    network = db.network_get_by_cidr(admin_context, fixed_range)
    net = {}
    if dis_project:
        net['project_id'] = None
    if dis_host:
        net['host'] = None
    if (dis_project or dis_host):
        if (project or host):
            error_msg = 'ERROR:    Unexpected    arguments    provided.    Please    use    separate    commands.'
            print(error_msg)
            return 1
        db.network_update(admin_context, network['id'], net)
        return
    if project:
        net['project_id'] = project
    if host:
        net['host'] = host
    db.network_update(admin_context, network['id'], net)
