Skip to content
This repository has been archived by the owner on Oct 13, 2023. It is now read-only.

Commit

Permalink
Update print method
Browse files Browse the repository at this point in the history
  • Loading branch information
Ximinhan committed Jul 31, 2023
1 parent 4e740f6 commit acd6068
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 7 deletions.
12 changes: 6 additions & 6 deletions doozerlib/cli/__main__.py
Original file line number Diff line number Diff line change
Expand Up @@ -181,7 +181,7 @@ def db_select(runtime, operation, attribute, match, like, where, sort_by, limit,

runtime.initialize(clone_distgits=False, no_group=True)
if not runtime.datastore:
print('--datastore must be specified')
red_print('--datastore must be specified')
exit(1)

if not attribute: # No attribute names identified? return everything.
Expand Down Expand Up @@ -1492,7 +1492,7 @@ def config_read_group(runtime, key, as_len, as_yaml, permit_missing_group, defau
# but that branch does not exist yet. Caller must specify --permit-missing to allow
# this behavior.
if permit_missing_group and default:
print(default)
red_print(default)
exit(0)
raise

Expand All @@ -1503,7 +1503,7 @@ def config_read_group(runtime, key, as_len, as_yaml, permit_missing_group, defau
value = dict_get(group_primitive, key, None)
if value is None:
if default is not None:
print(default)
red_print(default)
exit(0)
raise DoozerFatalError('No default specified and unable to find key: {}'.format(key))

Expand Down Expand Up @@ -1814,7 +1814,7 @@ def config_rhcos_src(runtime: Runtime, version, output, brew_root, arch):
brew_packages_path = brew_root_path.joinpath('packages')

if not brew_packages_path.is_dir():
print(f'Brewroot packages must be a directory: {str(brew_packages_path)}')
red_print(f'Brewroot packages must be a directory: {str(brew_packages_path)}')
exit(1)

output_path = pathlib.Path(output)
Expand All @@ -1829,10 +1829,10 @@ def config_rhcos_src(runtime: Runtime, version, output, brew_root, arch):
out_src_dir = out_base_dir_path.joinpath('src')
if out_src_dir.exists():
if out_src_dir.is_symlink():
print(f'Output directory already contains a symlink for {package_nvr}. Skipping.')
runtime.logger.info(f'Output directory already contains a symlink for {package_nvr}. Skipping.')
continue
else:
print(f'File already exists; cannot replace with brewroot content: {str(out_src_dir)}')
red_print(f'File already exists; cannot replace with brewroot content: {str(out_src_dir)}')
exit(1)

out_src_dir.symlink_to(str(src_dir_path.absolute()))
Expand Down
2 changes: 1 addition & 1 deletion doozerlib/cli/images_streams.py
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,7 @@
from doozerlib import brew, state, exectools, model, constants
from doozerlib.image import ImageMetadata
from doozerlib.util import get_docker_config_json, convert_remote_git_to_ssh, \
split_git_url, remove_prefix, green_print,\
split_git_url, remove_prefix, green_print, \
yellow_print, red_print, convert_remote_git_to_https, \
what_is_in_master, extract_version_fields, convert_remote_git_to_https

Expand Down

0 comments on commit acd6068

Please sign in to comment.