Fix fleet package generation (#1296)

* Fix fleet package generation
* Add .lstrip()
* Lint fix
* Add newline
This commit is contained in:
Ross Wolf
2021-06-17 06:16:09 -06:00
committed by GitHub
parent f6839e98d1
commit e897a67604
3 changed files with 21 additions and 34 deletions
+4 -4
View File
@@ -471,9 +471,9 @@ class Package(object):
manifest_file = package_dir / 'manifest.yml'
readme_file = docs_dir / 'README.md'
notice_file = package_dir / 'NOTICE.txt'
logo_file = package_dir / 'img' / 'security-logo-color-64px.png'
logo_file = package_dir / 'img' / 'security-logo-color-64px.svg'
manifest_file.write_text(yaml.safe_dump(manifest.asdict()))
manifest_file.write_text(yaml.safe_dump(manifest.to_dict()))
logo_file.parent.mkdir(parents=True)
shutil.copyfile(FLEET_PKG_LOGO, logo_file)
@@ -485,7 +485,7 @@ class Package(object):
notice_contents = Path(NOTICE_FILE).read_text()
readme_text = textwrap.dedent("""
# Detection rules
# Prebuilt Security Detection Rules
The detection rules package stores the prebuilt security rules for the Elastic Security [detection engine](https://www.elastic.co/guide/en/security/7.13/detection-engine-overview.html).
@@ -495,7 +495,7 @@ class Package(object):
## License Notice
""") + textwrap.indent(notice_contents, prefix=" ") # noqa: E501
""").lstrip() + textwrap.indent(notice_contents, prefix=" ") # noqa: E501
readme_file.write_text(readme_text)
notice_file.write_text(notice_contents)