Commit 1b52398d authored by Victor Nikulshin's avatar Victor Nikulshin
Browse files

Merge branch '2.x-feature/clear-pyc' into '2.x'

Clear cached bytecode file after local_vars.py modification



See merge request !37
parents 79f1e301 10c7f2f9
Loading
Loading
Loading
Loading
Loading
+6 −3
Original line number Diff line number Diff line
@@ -136,9 +136,12 @@ def fab_remove_from_hosts(site_hostname):


def fab_update_container_ip(container_ip):
    local('sed -i "/env.container_ip/d" {}/local_vars.py'.format(path.dirname(path.abspath(__file__))))
    local('sed -i "/# Docker auto-added container IP/a env.container_ip = \'{}\'" '
          '{}/local_vars.py'.format(''.join(container_ip), path.dirname(path.abspath(__file__))))
    local('sed -i "/env.container_ip/d" {}'.format(fab_path('local_vars.py')))
    local('sed -i "/# Docker auto-added container IP/a env.container_ip = \'{}\'" {}'.format(''.join(container_ip), fab_path('local_vars.py')))

    if os.path.exists(fab_path('local_vars.pyc')):
        # Clear cached bytecode file
        os.remove(fab_path('local_vars.pyc'))


def fab_update_hosts(ip, site_hostname):