@@ -55,20 +55,7 @@ def __init__(self, dvs):
55
55
keys = atbl .getKeys ()
56
56
57
57
assert len (keys ) >= 1
58
- # Filter out DTel Acl tables
59
- default_table_found = False
60
- for k in keys :
61
- if default_table_found :
62
- break
63
- (status , fvs ) = atbl .get (k )
64
- for item in fvs :
65
- if item [0 ] == "SAI_ACL_TABLE_ATTR_ACL_BIND_POINT_TYPE_LIST" :
66
- if 'SAI_ACL_BIND_POINT_TYPE_PORT' in item [1 ]:
67
- self .default_acl_table = k
68
- default_table_found = True
69
- break
70
- else :
71
- break
58
+ self .default_acl_tables = keys
72
59
73
60
atbl = swsscommon .Table (self .adb , "ASIC_STATE:SAI_OBJECT_TYPE_ACL_ENTRY" )
74
61
keys = atbl .getKeys ()
@@ -179,9 +166,13 @@ def __init__(self, name=None):
179
166
network_mode = "container:%s" % self .ctn_sw .name ,
180
167
volumes = { self .mount : { 'bind' : '/var/run/redis' , 'mode' : 'rw' } })
181
168
182
- self .ctn .exec_run ("sysctl -w net.ipv6.conf.all.disable_ipv6=0" )
183
- self .check_ready ()
184
- self .init_asicdb_validator ()
169
+ try :
170
+ self .ctn .exec_run ("sysctl -w net.ipv6.conf.all.disable_ipv6=0" )
171
+ self .check_ready ()
172
+ self .init_asicdb_validator ()
173
+ except :
174
+ self .destroy ()
175
+ raise
185
176
186
177
def destroy (self ):
187
178
if self .cleanup :
@@ -199,7 +190,11 @@ def check_ready(self, timeout=30):
199
190
started = 0
200
191
while True :
201
192
# get process status
202
- out = self .ctn .exec_run ("supervisorctl status" )
193
+ res = self .ctn .exec_run ("supervisorctl status" )
194
+ try :
195
+ out = res .output
196
+ except AttributeError :
197
+ out = res
203
198
for l in out .split ('\n ' ):
204
199
fds = re_space .split (l )
205
200
if len (fds ) < 2 :
@@ -231,7 +226,14 @@ def init_asicdb_validator(self):
231
226
self .asicdb = AsicDbValidator (self )
232
227
233
228
def runcmd (self , cmd ):
234
- return self .ctn .exec_run (cmd )
229
+ res = self .ctn .exec_run (cmd )
230
+ try :
231
+ exitcode = res .exit_code
232
+ out = res .output
233
+ except AttributeError :
234
+ exitcode = 0
235
+ out = res
236
+ return (exitcode , out )
235
237
236
238
def copy_file (self , path , filename ):
237
239
tarstr = StringIO .StringIO ()
0 commit comments