This happens when suricata-update is installed bundled with
Suricata. This is more a relic from the earlier days
of Suricata-Update when more users were likely to install
it directly from git anyways.
try:
from suricata.update.revision import revision
except:
- revision = "unknown"
+ revision = None
# Initialize logging, use colour if on a tty.
if len(logging.root.handlers) == 0 and os.isatty(sys.stderr.fileno()):
global_args, rem = global_parser.parse_known_args()
if global_args.version:
- print("suricata-update version %s (rev: %s)" % (version, revision))
+ revision_string = " (rev: %s)" % (revision) if revision else ""
+ print("suricata-update version {}{}".format(version, revision_string))
return 0
if not rem or rem[0].startswith("-"):