mirror of
https://github.com/resf/distro-tools.git
synced 2024-11-22 05:01:26 +00:00
Check if isdir
This commit is contained in:
parent
c64f9621fa
commit
de3d7526f2
@ -87,6 +87,10 @@ async def scan_path(
|
|||||||
|
|
||||||
logger.warning("Searching for arches in %s", repo_base)
|
logger.warning("Searching for arches in %s", repo_base)
|
||||||
|
|
||||||
|
if not os.path.isdir(repo_base):
|
||||||
|
logger.warning("Path is not a directory: %s, skipping", repo_base)
|
||||||
|
continue
|
||||||
|
|
||||||
# All dirs in repo_base is an architecture
|
# All dirs in repo_base is an architecture
|
||||||
for arch_ in os.listdir(repo_base):
|
for arch_ in os.listdir(repo_base):
|
||||||
if repo_first:
|
if repo_first:
|
||||||
@ -260,12 +264,14 @@ async def update_repomd_xml(repomd_xml_path: str, updateinfo: dict):
|
|||||||
)
|
)
|
||||||
|
|
||||||
# Write to repomd.xml
|
# Write to repomd.xml
|
||||||
|
logger.info("Writing to %s", repomd_xml_path)
|
||||||
with open(repomd_xml_path, "w", encoding="utf-8") as f:
|
with open(repomd_xml_path, "w", encoding="utf-8") as f:
|
||||||
f.write(xml_str)
|
f.write(xml_str)
|
||||||
|
|
||||||
# Delete old updateinfo file
|
# Delete old updateinfo file
|
||||||
if existing_updateinfo_path:
|
if existing_updateinfo_path:
|
||||||
try:
|
try:
|
||||||
|
logger.info("Deleting %s", existing_updateinfo_path)
|
||||||
os.remove(existing_updateinfo_path)
|
os.remove(existing_updateinfo_path)
|
||||||
except FileNotFoundError:
|
except FileNotFoundError:
|
||||||
logger.warning("File %s not found", existing_updateinfo_path)
|
logger.warning("File %s not found", existing_updateinfo_path)
|
||||||
|
Loading…
Reference in New Issue
Block a user