Modified command filtering to always allow empty command environments and updated ItemizedCommand to include empty envrionments and tags attributes by default.

development
Shawn Davis 4 years ago
parent 02a63172e9
commit 5db2141614
  1. 2
      VERSION.txt
  2. 5
      scripttease/library/commands/base.py
  3. 2
      scripttease/parsers/utils.py
  4. 6
      scripttease/version.py

@ -1 +1 @@
6.8.1
6.8.2

@ -198,6 +198,11 @@ class ItemizedCommand(object):
self.kwargs = kwargs
self.name = name
# Set defaults for when ItemizedCommand is referenced directly before individual commands are instantiated. For
# example, when command filtering occurs.
self.kwargs.setdefault("environments", list())
self.kwargs.setdefault("tags", list())
def __getattr__(self, item):
return self.kwargs.get(item)

@ -38,7 +38,7 @@ def filter_commands(commands, environments=None, tags=None):
"""
filtered = list()
for command in commands:
if environments is not None:
if environments is not None and len(command.environments) > 0:
if not any_list_item(environments, command.environments):
continue

@ -1,5 +1,5 @@
DATE = "2021-01-01"
VERSION = "6.8.1"
DATE = "2021-01-26"
VERSION = "6.8.2"
MAJOR = 6
MINOR = 8
PATCH = 1
PATCH = 2

Loading…
Cancel
Save