@@ -76,46 +76,6 @@ def pytest_configure(config):
76
76
logging .getLogger ().warning (msg )
77
77
config .option .molecule [driver ]["available" ] = False
78
78
79
- if driver == "delegated" :
80
- # To protect ourselves from case where a molecule scenario using
81
- # `delegated` is accidentally altering the localhost on a developer
82
- # machine, we verify run delegated tests only when ansible `zuul`
83
- # or `use_for_testing` vars are defined.
84
- cmd = [
85
- "ansible" ,
86
- "localhost" ,
87
- "-e" ,
88
- "ansible_connection=local" ,
89
- "-o" ,
90
- "-m" ,
91
- "shell" ,
92
- "-a" ,
93
- "exit {% if zuul is defined or use_for_testing is defined %}0{% else %}1{% endif %}" ,
94
- ]
95
- try :
96
- p = subprocess .Popen (
97
- cmd ,
98
- stdout = subprocess .DEVNULL ,
99
- stderr = subprocess .DEVNULL ,
100
- universal_newlines = True ,
101
- )
102
- p .wait ()
103
- if p .returncode != 0 :
104
- raise Exception (
105
- "Error code %s returned by: %s"
106
- % (p .returncode , " " .join (cmd ))
107
- )
108
- except Exception :
109
- msg = "Molecule {} driver was not enabled because missing zuul.build variable in current inventory." .format (
110
- driver
111
- )
112
- if config .option .molecule_unavailable_driver :
113
- msg += " We will tag scenarios using it with '{}' marker." .format (
114
- config .option .molecule_unavailable_driver
115
- )
116
- logging .getLogger ().warning (msg )
117
- config .option .molecule [driver ]["available" ] = False
118
-
119
79
config .addinivalue_line (
120
80
"markers" , "molecule: mark used by all molecule scenarios"
121
81
)
0 commit comments