+ try:
+ directory = environ["TMPDIR"]
+ except KeyError:
+ directory = None
+
+ if directory is not None:
+ tmpfile = NamedTemporaryFile(suffix=".tgz", prefix="openvpp-testing-",
+ dir="{0}".format(directory))
+ else:
+ tmpfile = NamedTemporaryFile(suffix=".tgz", prefix="openvpp-testing-")