def main():
    config.parse_args(sys.argv)
    utils.monkey_patch()

    _session = session.XenAPISession(CONF.xenserver.connection_url,
                                     CONF.xenserver.connection_username,
                                     CONF.xenserver.connection_password)

    sr_ref = vm_utils.safe_find_sr(_session)
    destroyed = vm_utils.destroy_cached_images(
        _session, sr_ref, all_cached=CONF.all_cached,
        dry_run=CONF.dry_run)

    if '--verbose' in sys.argv:
        print '\n'.join(destroyed)

    print "Destroyed %d cached VDIs" % len(destroyed)
dataset/ETHPy150Open BU-NU-CLOUD-SP16/Trusted-Platform-Module-nova/tools/xenserver/destroy_cached_images.py/main/original