Fix package endswith error

This commit is contained in:
mycognosist 2020-12-16 10:12:08 +00:00
parent 3c04a58570
commit b972f1274a
1 changed files with 4 additions and 4 deletions

View File

@ -125,11 +125,11 @@ for service in SERVICES:
print("[ ADDING PACKAGES TO FREIGHT LIBRARY ]")
# loop through all files in the microservices deb directory
for filename in os.scandir(MICROSERVICES_DEB_DIR):
for package in os.scandir(MICROSERVICES_DEB_DIR):
# avoid any files which are not debian packages
if filename.endswith(".deb"):
print("[ ADDING PACKAGE {} ]".format(filename.name))
subprocess.call(["freight", "add", "-c", FREIGHT_CONF, filename.path, "apt/buster"])
if package.name.endswith(".deb"):
print("[ ADDING PACKAGE {} ]".format(package.name))
subprocess.call(["freight", "add", "-c", FREIGHT_CONF, package.path, "apt/buster"])
print("[ ADDING PACKAGES TO FREIGHT CACHE ]")
# needs to be run as sudo user