Skip to content

Commit 35beb36

Browse files
authored
Merge pull request #71 from pafernanr/devel
FIX argutment showall
2 parents 7883d8e + 76b5abe commit 35beb36

File tree

4 files changed

+9
-10
lines changed

4 files changed

+9
-10
lines changed

README.md

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -17,8 +17,8 @@ Companion command `dynflowparser-export-tasks` helps to overcome `sosreport` fil
1717

1818
#### Dependencies
1919
Required python libraries:
20-
- Jinja2>=3.1.3
21-
- python_dateutil>=2.8.2
20+
- Jinja2
21+
- pytz
2222

2323
#### Installation
2424
~~~

dynflowparser/__init__.py

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -160,8 +160,7 @@ def main(self):
160160
self.conf.sos['timezone'],
161161
ends)
162162
if (dfrom <= starts <= dto) or (dfrom <= ends <= dto):
163-
# include only success tasks or all
164-
if self.conf.unsuccess:
163+
if not self.conf.args.showall:
165164
if dline[headers.index('result')] != 'success':
166165
self.conf.dynflowdata['includedUUID'].append(
167166
dline[headers.index('external_id')]

dynflowparser/lib/configuration.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -15,7 +15,6 @@ def __init__(self):
1515
'actions': {'times': 0},
1616
'includedUUID': [],
1717
}
18-
self.unsuccess = True
1918
self.writesql = True
2019
self.sos = {}
2120
self.dbfile = ""
@@ -27,6 +26,7 @@ def __init__(self):
2726
self.parser.add_argument(
2827
'-a',
2928
'--all',
29+
dest='showall',
3030
help='Parse all. By default only unsuccess plans are parsed.',
3131
default=False,
3232
action='store_true'

dynflowparser/lib/outputhtml.py

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -32,10 +32,10 @@ def write(self):
3232

3333
def write_tasks(self):
3434
self.util.debug("I", "write_tasks")
35-
if self.conf.unsuccess:
36-
where = " AND t.result != 'success'"
37-
else:
35+
if self.conf.args.showall:
3836
where = ""
37+
else:
38+
where = " AND t.result != 'success'"
3939

4040
tmp = self.db.query("SELECT t.parent_task_id, t.id, t.external_id,"
4141
+ " t.label, t.state, t.result, t.started_at,"
@@ -84,7 +84,7 @@ def write_actions(self):
8484
sql = ("SELECT * FROM steps ORDER BY id")
8585
rows = self.db.query(sql)
8686
for r in rows:
87-
if self.conf.unsuccess and r[8] == "success":
87+
if not self.conf.args.showall and r[8] == "success":
8888
continue
8989
r = list(r)
9090
r[12] = self.show_json(r[12])
@@ -115,7 +115,7 @@ def write_actions(self):
115115
self.pb.start_time = datetime.datetime.now()
116116
start_time = time.time()
117117
for r in rows:
118-
if self.conf.unsuccess and r[8] == "success":
118+
if not self.conf.args.showall and r[8] == "success":
119119
continue
120120
r = list(r)
121121
r[5] = self.show_json(r[5])

0 commit comments

Comments
 (0)