def push_release(parser, options):
    from fabric.api import run, local, put, settings
    atexit.register(fabric_cleanup, True)

    comm_obj = _CommObj()

    if options.releasedir is None:
        print "release directory was not specified"
        sys.exit(-1)

    destdir = options.destdir
    if destdir is None:
        if os.path.basename(options.releasedir).startswith('rel_'):
            destdir = os.path.join(os.path.dirname(options.releasedir),
                                   "release_%s" %
                                   os.path.basename(options.releasedir).split('_', 1)[1])
        else:
            print "destination directory not supplied"
            sys.exit(-1)

    if os.path.isdir(destdir):
        print "destination dir '%s' already exists" % destdir
        sys.exit(-1)

    if not os.path.isdir(options.releasedir):
        print options.releasedir % "release directory %s not found"
        sys.exit(-1)

    if not ('@' in destdir or ':' in destdir): # it's a local release test area
        if not os.path.isdir(destdir):
            _setup_local_release_dir(destdir)
        comm_obj.put = shutil.copy
        comm_obj.put_dir = shutil.copytree
        comm_obj.run = local

        _push_release(options.releasedir, destdir, comm_obj,
                      py=options.py)
    else: # assume destdir is a remote user@host:destdir

        # the only remote push destination should be the production server
        # at openmdao.org, which doesn't have python 2.7 as default, so...
        if options.py == 'python':
            options.py = 'python2.7'

        comm_obj.put = put
        comm_obj.put_dir = put_dir
        comm_obj.run = run

        destparts = destdir.split(':', 1)
        if len(destparts) > 1:
            home = destparts[1]
        else:
            home = '~'

        with settings(host_string=destparts[0]):
            _push_release(options.releasedir, home, comm_obj,
                          py=options.py)
dataset/ETHPy150Open OpenMDAO/OpenMDAO-Framework/openmdao.devtools/src/openmdao/devtools/push_release.py/push_release/swapped operands of `%`