Skip to content

Commit 9e5baa1

Browse files
pre-commit-ci[bot]jajreidy
authored andcommitted
[pre-commit.ci] auto fixes from pre-commit.com hooks
for more information, see https://pre-commit.ci
1 parent 3c1a735 commit 9e5baa1

File tree

2 files changed

+10
-10
lines changed

2 files changed

+10
-10
lines changed

src/pushsource/_impl/backend/staged/staged_base.py

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,7 @@ class TypeHandler(object):
1010
# Decorator for handling specific file directories (e.g. "FILES", "ISOS" etc)
1111
HANDLERS = {}
1212

13-
def __init__(self, type_name, accepts = lambda entry: entry.is_file()):
13+
def __init__(self, type_name, accepts=lambda entry: entry.is_file()):
1414
self.type_name = type_name
1515
self.accepts = accepts
1616

@@ -33,7 +33,8 @@ def __init__(self, *args, **kwargs):
3333
fn, accepts = TypeHandler.HANDLERS[typename]
3434
bound_fn = partial(fn, self)
3535
self._FILE_TYPES[typename] = partial(
36-
self.__mixin_push_items, delegate=bound_fn, accepts=accepts)
36+
self.__mixin_push_items, delegate=bound_fn, accepts=accepts
37+
)
3738

3839
def __mixin_push_items(self, leafdir, metadata, delegate, accepts):
3940
out = []

src/pushsource/_impl/backend/staged/staged_cloud.py

Lines changed: 7 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -104,12 +104,8 @@ def __build_azure_push_item(self, resources, origin, name, dest):
104104

105105
def __process_builds(self, current_dir, leafdir):
106106
yaml_path = os.path.join(current_dir, "resources.yaml")
107-
try:
108-
with open(yaml_path, "rt") as fh:
109-
raw = yaml.safe_load(fh)
110-
except FileNotFoundError:
111-
LOG.warning("No resources.yaml file found at %s (ignored)", yaml_path)
112-
return
107+
with open(yaml_path, "rt") as fh:
108+
raw = yaml.safe_load(fh)
113109
if not raw:
114110
LOG.warning("Resources.yaml file at %s is empty (ignored)", yaml_path)
115111
return
@@ -134,8 +130,11 @@ def __process_builds(self, current_dir, leafdir):
134130
)
135131
return out
136132

137-
@handles_type("CLOUD_IMAGES",
138-
accepts=lambda entry: entry.is_dir() and os.path.exists(os.path.join(entry.path, "resources.yaml")))
133+
@handles_type(
134+
"CLOUD_IMAGES",
135+
accepts=lambda entry: entry.is_dir()
136+
and os.path.exists(os.path.join(entry.path, "resources.yaml")),
137+
)
139138
def __cloud_push_item(self, leafdir, metadata, entry):
140139
out = self.__process_builds(entry.path, leafdir)
141140

0 commit comments

Comments
 (0)