summary |
shortlog |
log |
commit | commitdiff |
review |
tree
raw |
patch |
inline | side by side (from parent 1:
9440d0f)
- Add creation of tar.gz file
Change-Id: I525c713bb3e157cd94337222781066252c3fa517
Signed-off-by: Tibor Frank <tifrank@cisco.com>
from email.mime.multipart import MIMEMultipart
from os.path import isdir
from email.mime.multipart import MIMEMultipart
from os.path import isdir
+from utils import execute_command
from errors import PresentationError
from errors import PresentationError
except IOError:
logging.error("Not possible to write the file '{0}.html'.".
format(file_name))
except IOError:
logging.error("Not possible to write the file '{0}.html'.".
format(file_name))
+
+ zip_file = config.get("zip-output", None)
+ if zip_file:
+ logging.info("Writing the file '{0}/{1}' ...".
+ format(config["output-dir"], zip_file))
+ execute_command("tar czvf {dir}/{zip} {dir}/{input}.*".format(
+ dir=config["output-dir"],
+ zip=zip_file,
+ input=config["output-file"]))
else:
raise AlertingError("Alert of type '{0}' is not implemented.".
format(alert["type"]))
else:
raise AlertingError("Alert of type '{0}' is not implemented.".
format(alert["type"]))
output-dir: "_build/_static/vpp"
# The name of the output files. ASCII text and HTML formats are
# generated.
output-dir: "_build/_static/vpp"
# The name of the output files. ASCII text and HTML formats are
# generated.
- output-file: "jenkins-alert-failed-tests"
+ output-file: "trending-failed-tests"
+ # If defined, all output files are zipped into this file.
+ zip-output: "failed-tests.tar.gz"
:param cmd: Command to execute.
:type cmd: str
:param cmd: Command to execute.
:type cmd: str
- :returns: Return code of the executed command.
- :rtype: int
+ :returns: Return code of the executed command, stdout and stderr.
+ :rtype: tuple(int, str, str)