@@ -361,6 +361,12 @@ def main():
if layerbranch.actual_branch:
branchname = layerbranch.actual_branch
branchdesc = "%s (%s)" % (branch, branchname)
+
+ layerbranch_updates_enabled = LayerBranch.objects.filter(layer=layer,
+ branch=branchobj.id, updates_enabled=True)
+ if not layerbranch_updates_enabled:
+ logger.info("Skipping update of layer %s branch %s - updates disabled" % (layer.name, branchname))
+ continue
else:
# LayerBranch doesn't exist for this branch, create it temporarily
# (we won't save this - update_layer.py will do the actual creation
@@ -375,11 +381,6 @@ def main():
if layerbranch_source:
layerbranch.vcs_subdir = layerbranch_source.vcs_subdir
- layerbranch_updates_enabled = LayerBranch.objects.filter(layer=layer, branch=branchobj.id, updates_enabled=True)
- if not layerbranch_updates_enabled:
- logger.info("Skipping update of layer %s branch %s - updates disabled" % (layer.name, branchname))
- continue
-
# Collect repo info
urldir = layer.get_fetch_dir()
repodir = os.path.join(fetchdir, urldir)
When a new release is run for the first time, no LayerBranch exists yet and the update_enabled cannot be queried. The unintended result is that all layers are skipped. Move the update_enabled check into the code path where the layerbranch already exists. Signed-off-by: Tim Orling <tim.orling@konsulko.com> --- layerindex/update.py | 11 ++++++----- 1 file changed, 6 insertions(+), 5 deletions(-)