Skip to content

Commit

Permalink
Merge pull request #120 from devopshq/hotfix/disable-fallback-in-recu…
Browse files Browse the repository at this point in the history
…rsion

Disable recursion lock-file fallback if not found
  • Loading branch information
antonzolotukhin authored Oct 19, 2022
2 parents e3dd625 + b0fc31d commit ee56ed5
Show file tree
Hide file tree
Showing 3 changed files with 6 additions and 8 deletions.
6 changes: 3 additions & 3 deletions crosspm/adapters/artifactoryaql.py
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,6 @@
from crosspm.adapters.common import BaseAdapter
from crosspm.helpers.exceptions import * # noqa
from crosspm.helpers.package import Package
from crosspm.helpers.config import CROSSPM_DEPENDENCY_LOCK_FILENAME


CHUNK_SIZE = 1024
Expand Down Expand Up @@ -273,8 +272,9 @@ def get_packages(self, source, parser, downloader, list_or_file_path, property_v
if downloader.do_load:
_package.download()
_deps_file = _package.get_file(self._config.deps_lock_file_name)
if not _deps_file:
_deps_file = _package.get_file(CROSSPM_DEPENDENCY_LOCK_FILENAME)
# TODO: turn on this fallback after testing
# if not _deps_file:
# _deps_file = _package.get_file(CROSSPM_DEPENDENCY_LOCK_FILENAME)
if downloader.recursive:
if _deps_file:
_package.find_dependencies(_deps_file, property_validate=False)
Expand Down
6 changes: 3 additions & 3 deletions crosspm/adapters/files.py
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,6 @@
from crosspm.adapters.common import BaseAdapter
from crosspm.helpers.exceptions import * # noqa
from crosspm.helpers.package import Package
from crosspm.helpers.config import CROSSPM_DEPENDENCY_LOCK_FILENAME
import os

CHUNK_SIZE = 1024
Expand Down Expand Up @@ -210,8 +209,9 @@ def get_packages(self, source, parser, downloader, list_or_file_path):
if downloader.do_load:
_package.download()
_deps_file = _package.get_file(self._config.deps_lock_file_name)
if not _deps_file:
_deps_file = _package.get_file(CROSSPM_DEPENDENCY_LOCK_FILENAME)
# TODO: turn on this fallback after testing
# if not _deps_file:
# _deps_file = _package.get_file(CROSSPM_DEPENDENCY_LOCK_FILENAME)
if _deps_file:
_package.find_dependencies(_deps_file)
elif self._config.deps_file_name:
Expand Down
2 changes: 0 additions & 2 deletions crosspm/helpers/config.py
Original file line number Diff line number Diff line change
Expand Up @@ -50,8 +50,6 @@

class Config:
windows = WINDOWS
default_deps_file_name = CROSSPM_DEPENDENCY_FILENAME
default_deps_lock_file_name = CROSSPM_DEPENDENCY_LOCK_FILENAME

def __init__(self, config_file_name='', cmdline='', no_fails=False, deps_lock_file_path='', deps_file_path='',
lock_on_success=False, prefer_local=False, deps_content=None, deps_lock_content=None):
Expand Down

0 comments on commit ee56ed5

Please sign in to comment.