Skip to content

f-string changes for user, virt, vlan and vpn module #1983

@JayasilanJibm

Description

@JayasilanJibm

This issue pertains to f-string notation changes from .format notation for user, virt, clan and vpn module.

This issue is created as a child issue for PR #1547

The following files/statement/expression have been modified to reflect the changes:

SoftLayer/CLI/user/list.py: user = _yes_format(user, [TWO_FACTO_AUTH, CLASSIC_API_KEYS])
SoftLayer/CLI/user/list.py:def _yes_format(user, keys):
SoftLayer/CLI/user/vpn_manual.py: message = "{} vpn manual config {}".format(user, 'enable' if enable else 'disable')
SoftLayer/CLI/user/vpn_manual.py: click.secho("Failed to update {}".format(user), fg='red')

SoftLayer/CLI/virt/cancel.py: env.fout("The virtual server instance: {} was cancelled.".format(vs_id))
SoftLayer/CLI/virt/create.py: click.secho('Warning: Closed soon: {}'.format(pod['name']), fg='yellow')
SoftLayer/CLI/virt/detail.py: last_transaction = "{} ({})".format(utils.lookup(result, 'lastTransaction', 'transactionGroup', 'name'),
SoftLayer/CLI/virt/dns.py: message = "{} does not have an ipv6 address".format(instance['fullyQualifiedDomainName'])
SoftLayer/CLI/virt/edit.py: env.fout("The {} of virtual server instance: {} was updated.".format(key, vs_id))
SoftLayer/CLI/virt/edit.py: env.fout("The public speed of virtual server instance: {} was updated.".format(vs_id))
SoftLayer/CLI/virt/edit.py: env.fout("The private speed of virtual server instance: {} was updated.".format(vs_id))
SoftLayer/CLI/virt/migrate.py: click.secho("Started a migration on {}".format(vsi_id), fg='green')
SoftLayer/CLI/virt/migrate.py: click.secho("Failed to migrate {}. {}".format(vsi_id, str(ex)), fg='red')
SoftLayer/CLI/virt/notification_delete.py: env.fout("The virtual server notification instance: {} was deleted.".format(identifier))
SoftLayer/CLI/virt/storage.py: "{capacity} {unit}".format(capacity=disk['diskImage']['capacity'],

SoftLayer/CLI/vlan/cancel.py: env.fout("VLAN {} was cancelled.".format(identifier))
SoftLayer/CLI/vlan/create.py: "Unable to find pod name: {}".format(pod))

SoftLayer/CLI/vpn/ipsec/cancel.py: env.fout("Ipsec {} was cancelled.".format(identifier))
SoftLayer/CLI/vpn/ipsec/configure.py: click.echo('Configuration request received for context #{}'.format(context_id))
SoftLayer/CLI/vpn/ipsec/configure.py: raise CLIHalt('Failed to enqueue configuration request for context #{}'.format(context_id))
SoftLayer/CLI/vpn/ipsec/detail.py: return '[mask[{}]]'.format(','.join(entries))
SoftLayer/CLI/vpn/ipsec/subnet/add.py: .format(subnet_type))
SoftLayer/CLI/vpn/ipsec/subnet/add.py: .format(network_identifier[0],
SoftLayer/CLI/vpn/ipsec/subnet/add.py: env.out('Added {} subnet #{}'.format(subnet_type, subnet_id))
SoftLayer/CLI/vpn/ipsec/subnet/add.py: .format(subnet_type, subnet_id))
SoftLayer/CLI/vpn/ipsec/subnet/remove.py: env.out('Removed {} subnet #{}'.format(subnet_type, subnet_id))
SoftLayer/CLI/vpn/ipsec/subnet/remove.py: .format(subnet_type, subnet_id))
SoftLayer/CLI/vpn/ipsec/translation/add.py: .format(static_ip, remote_ip, translation['id']))
SoftLayer/CLI/vpn/ipsec/translation/remove.py: env.out('Removed translation #{}'.format(translation_id))
SoftLayer/CLI/vpn/ipsec/translation/remove.py: raise CLIHalt('Failed to remove translation #{}'.format(translation_id))
SoftLayer/CLI/vpn/ipsec/translation/update.py: env.out('Updated translation #{}'.format(translation_id))
SoftLayer/CLI/vpn/ipsec/translation/update.py: raise CLIHalt('Failed to update translation #{}'.format(translation_id))
SoftLayer/CLI/vpn/ipsec/update.py: env.out('Updated context #{}'.format(context_id))
SoftLayer/CLI/vpn/ipsec/update.py: raise CLIHalt('Failed to update context #{}'.format(context_id))

The changes also include change from %s or %I string notation to f-string in few statements across these files.

Thanks,
Jayasilan

Metadata

Metadata

Assignees

Labels

CoreIssues dealing with core functionality

Type

No type

Projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions