Skip to content

Commit

Permalink
update the code for f-format and comments
Browse files Browse the repository at this point in the history
  • Loading branch information
yanpliu committed Mar 11, 2024
1 parent e0c4606 commit 5598f75
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 16 deletions.
15 changes: 1 addition & 14 deletions robottelo/utils/virtwho.py
Original file line number Diff line number Diff line change
Expand Up @@ -592,20 +592,7 @@ def vw_fake_conf_create(
rhsm_encrypted_password = f'rhsm_encrypted_password={rhsm_encrypted_password}\n'
rhsm_prefix = 'rhsm_prefix=/rhsm\n'
rhsm_port = 'rhsm_port=443\n'
cmd = ('cat <<EOF > {}' '{}' '{}' '{}' '{}' '{}' '{}' '{}' '{}' '{}' '{}' '{}' 'EOF').format(
file,
title,
type,
json,
is_hypervisor,
owner,
env,
rhsm_hostname,
rhsm_username,
rhsm_encrypted_password,
rhsm_prefix,
rhsm_port,
)
cmd = f'cat <<EOF > {file}\n{title}\n{type}\n{json}\n{is_hypervisor}\n{owner}\n{env}\n{rhsm_hostname}\n{rhsm_username}\n{rhsm_encrypted_password}\n{rhsm_prefix}\n{rhsm_port}\nEOF'
runcmd(cmd)


Expand Down
5 changes: 3 additions & 2 deletions tests/foreman/virtwho/cli/test_esx_sca.py
Original file line number Diff line number Diff line change
Expand Up @@ -527,9 +527,9 @@ def test_positive_post_hypervisors_with_fake_different_org_simultaneous(
:BZ: 2173870
"""

# create 3 hypersiors and each have 3 guests json file
# create json file for 3 hyperviors, each with 3 guests
json_file = Path("/tmp/fake.json")
data = hypervisor_fake_json_create(hypervisors=1, guests=1)
data = hypervisor_fake_json_create(hypervisors=3, guests=3)
json_file.write_text(json.dumps(data))
# create 10 fake files in module_sca_manifest_org
virtwho_config_cli = target_sat.cli.VirtWhoConfig.create(form_data_cli)[
Expand Down Expand Up @@ -581,6 +581,7 @@ def test_positive_post_hypervisors_with_fake_different_org_simultaneous(
fake_conf_file,
json_file,
)
# run virt-who with option -d, --debug and -o, --one-shot
vw_run_option("od")
for i in range(10):
fake_conf_file = f"/etc/virt-who.d/virt-who-config-fake{i}.conf"
Expand Down

0 comments on commit 5598f75

Please sign in to comment.