Esempio n. 1
0
 def it_returns_the_role_for_multiple_hosts_with_multiple_roles():
     env.roledefs = {
         'app': ['app1.example.com', 'app2.example.com'],
         'db': ['app1.example.com', 'app2.example.com']
     }
     assert host_roles('app1.example.com') == ['app', 'db']
     assert host_roles('app2.example.com') == ['app', 'db']
Esempio n. 2
0
 def it_returns_the_role_for_multiple_hosts_with_multiple_roles():
     env.roledefs = {
         'app': ['app1.example.com', 'app2.example.com'],
         'db': ['app1.example.com', 'app2.example.com']
     }
     assert host_roles('app1.example.com') == ['app', 'db']
     assert host_roles('app2.example.com') == ['app', 'db']
Esempio n. 3
0
 def it_returns_the_roles_for_a_host_with_multiple_roles():
     env.roledefs = {
         'app': 'server.example.com',
         'db': 'server.example.com',
     }
     assert host_roles('server.example.com') == ['app', 'db']
Esempio n. 4
0
 def it_returns_the_role_for_a_host_with_a_single_role():
     env.roledefs = {'app': 'app.example.com'}
     assert host_roles('app.example.com') == ['app']
Esempio n. 5
0
def current_roles():
    return host_roles(env.host_string)
Esempio n. 6
0
 def it_returns_the_role_for_a_host_with_a_single_role():
     env.roledefs = {'app': 'app.example.com'}
     assert host_roles('app.example.com') == ['app']
Esempio n. 7
0
 def it_returns_the_roles_for_a_host_with_multiple_roles():
     env.roledefs = {
         'app': 'server.example.com',
         'db': 'server.example.com',
     }
     assert host_roles('server.example.com') == ['app', 'db']
Esempio n. 8
0
 def it_returns_the_role_for_a_host_with_a_single_role():
     env.roledefs = {"app": "app.example.com"}
     assert host_roles("app.example.com") == ["app"]
Esempio n. 9
0
 def it_returns_the_role_for_multiple_hosts_with_multiple_roles():
     env.roledefs = {"app": ["app1.example.com", "app2.example.com"], "db": ["app1.example.com", "app2.example.com"]}
     assert host_roles("app1.example.com") == ["app", "db"]
     assert host_roles("app2.example.com") == ["app", "db"]
Esempio n. 10
0
 def it_returns_the_roles_for_a_host_with_multiple_roles():
     env.roledefs = {"app": "server.example.com", "db": "server.example.com"}
     assert host_roles("server.example.com") == ["app", "db"]
Esempio n. 11
0
def current_roles():
    return host_roles(env.host_string)