Skip to content

autotailor doesn't handle missing files --json-tailoring gracefully #2369

@Mab879

Description

@Mab879
$ autotailor --output without.xml --new-profile-id xccdf_org.ssgproject.content_profile_cis_server_l1 --json-tailoring test-one-rule.json /usr/share/xml/scap/ssg/content/ssg-rhel10-ds.xml
Traceback (most recent call last):
  File "/usr/bin/autotailor", line 457, in <module>
    t.import_json_tailoring(args.json_tailoring)
    ~~~~~~~~~~~~~~~~~~~~~~~^^^^^^^^^^^^^^^^^^^^^
  File "/usr/bin/autotailor", line 345, in import_json_tailoring
    with open(json_tailoring, "r") as jf:
         ~~~~^^^^^^^^^^^^^^^^^^^^^
FileNotFoundError: [Errno 2] No such file or directory: 'test-one-rule.json'
$ rpm -iq openscap
openscap-1.4.4-1.fc44.x86_64

Metadata

Metadata

Assignees

No one assigned

    Labels

    Type

    No type
    No fields configured for issues without a type.

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions