Esempio n. 1
0
 def decorated(*args, **kwargs):
     if not hasattr(env, 'patch'):
         env.patch = False
     state = version_state(func.__name__)
     if not env.patch and state:
         verbose = " ".join([
             env.host,
             func.__name__,
             "completed. Skipping...",
             ])
     elif env.patch and not state:
         verbose = " ".join([
             env.host,
             func.__name__,
             "not previously completed. Skipping...",
             ])
     else:
         results = func(*args, **kwargs)
         verbose = ''
         if results:
             set_version_state(func.__name__, object=results)
         else:
             set_version_state(func.__name__)
         return results
     if env.verbosity and verbose:
         print verbose
     return
Esempio n. 2
0
def rmvirtualenv():
    """
    Remove the current or ``env.project_version`` environment and all content in it
    """
    path = '/'.join([deployment_root(),'env',env.project_fullname])
    link = '/'.join([deployment_root(),'env',env.project_name])
    if version_state('mkvirtualenv'):
        sudo(' '.join(['rm -rf',path]))
        sudo(' '.join(['rm -f',link]))
        sudo('rm -f /var/local/woven/%s*'% env.project_fullname)
        set_version_state('mkvirtualenv',delete=True)
Esempio n. 3
0
def rmvirtualenv():
    """
    Remove the current or ``env.project_version`` environment and all content in it
    """
    path = '/'.join([deployment_root(), 'env', env.project_fullname])
    link = '/'.join([deployment_root(), 'env', env.project_name])
    if version_state('mkvirtualenv'):
        sudo(' '.join(['rm -rf', path]))
        sudo(' '.join(['rm -f', link]))
        sudo('rm -f /var/local/woven/%s*' % env.project_fullname)
        set_version_state('mkvirtualenv', delete=True)
Esempio n. 4
0
 def decorated(*args, **kwargs):
     if not hasattr(env, 'patch'): env.patch = False
     state = version_state(func.__name__)
     if not env.patch and state:
         verbose = " ".join(
             [env.host, func.__name__, "completed. Skipping..."])
     elif env.patch and not state:
         verbose = " ".join([
             env.host, func.__name__,
             "not previously completed. Skipping..."
         ])
     else:
         results = func(*args, **kwargs)
         verbose = ''
         if results: set_version_state(func.__name__, object=results)
         else: set_version_state(func.__name__)
         return results
     if env.verbosity and verbose: print verbose
     return
Esempio n. 5
0
File: env.py Progetto: zbrdge/woven
def test_env_version_state():
    with settings(host_string=HS, user=R, password=R):
        setup()
        env.project_fullname = 'example_project-0.1'
        sudo('rm -rf /var/local/woven')
        #test
        set_version_state('example', delete=True)
        set_version_state('example')
        assert version_state('example')
        set_version_state('example', object=['something'])
        state = version_state('example')
        assert state == ['something']
        state = version_state('example', prefix=True)
        assert state

        set_version_state('example', delete=True)
        state = version_state('example')
        assert not state
        teardown()
Esempio n. 6
0
def test_env_version_state():
    with settings(host_string=HS,user=R,password=R):
        setup()
        env.project_fullname = 'example_project-0.1'
        sudo('rm -rf /var/local/woven')
        #test
        set_version_state('example',delete=True)
        set_version_state('example')
        assert version_state('example')
        set_version_state('example',object=['something'])
        state = version_state('example')
        assert state == ['something']
        state = version_state('example', prefix=True)
        assert state
        
        set_version_state('example',delete=True)
        state = version_state('example')
        assert not state
        teardown()