New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
F-Strings - hardware / image / lb #1982
Merged
Merged
Conversation
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
added f{} strings
adjusted indentation in lookup.py
removed comments in metadata.py
removed and update to ''
removed '' and update to
replaced identifier position to account_id position inside f string
allmightyspiff
requested changes
Jun 12, 2023
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Fix merge conflicts
Hi Christopher, Can you please review it. Thanks, |
updated the string changes
Updated the fstring
Updated the string
updated the fstring
Hi, I have reviewed and verified the code. The changes seems to be fine to me. Thanks, |
JayasilanJibm
approved these changes
Jun 15, 2023
allmightyspiff
approved these changes
Jun 15, 2023
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Hi @allmightyspiff ,
I have updated line of code from .format() to f"{}" string.
Please review it and approve this pull request.
Please find the details.
Details:
Title: I am working on these files for hardware, image, licenses, loadbal, metadata and order command group.
Start using python f-strings #1981
Description:
hardware:
SoftLayer/CLI/hardware/create.py: click.secho('Warning: Closed soon: {}'.format(pod['name']), fg='yellow')
SoftLayer/CLI/hardware/detail.py: last_transaction = "{} ({})".format(utils.lookup(result, 'lastTransaction', 'transactionGroup', 'name'),
SoftLayer/CLI/hardware/dns.py: message = "{} does not have an ipv6 address".format(instance['fullyQualifiedDomainName'])
SoftLayer/CLI/hardware/notification_add.py: raise exceptions.CLIAbort("User not found: {}.".format(user))
SoftLayer/CLI/hardware/notification_delete.py: env.fout("The hardware notification instance: {} was deleted.".format(identifier))
image:
SoftLayer/CLI/image/share.py: env.fout("Image template {} was shared to account {}.".format(identifier, account_id))
SoftLayer/CLI/image/share_deny.py: env.fout("Image template {} was deny shared to account {}.".format(identifier, account_id))
licenses:
SoftLayer/CLI/licenses/cancel.py: env.fout("License key: {} was cancelled.".format(key))
loadbal:
SoftLayer/CLI/loadbal/detail.py: table.add_row(['Status', "{} / {}".format(this_lb.get('provisioningStatus'), this_lb.get('operatingStatus'))])
SoftLayer/CLI/loadbal/detail.py: priv_map = "{}:{}".format(pool['protocol'], pool['protocolPort'])
SoftLayer/CLI/loadbal/detail.py: mapping = "{}:{} -> {}".format(listener.get('protocol'), listener.get('protocolPort'), priv_map)
SoftLayer/CLI/loadbal/health.py: print("UUID: {}, ID: {}".format(lb_uuid, lb_id))
SoftLayer/CLI/loadbal/health.py: click.secho('Health Check {} updated successfully'.format(uuid), fg='green')
SoftLayer/CLI/loadbal/health.py: click.secho('Failed to update {}'.format(uuid), fg='red')
SoftLayer/CLI/loadbal/health.py: click.secho("ERROR: {}".format(exception.faultString), fg='red')
SoftLayer/CLI/loadbal/members.py: click.secho("Member {} removed".format(member), fg='green')
SoftLayer/CLI/loadbal/members.py: click.secho("ERROR: {}".format(exception.faultString), fg='red')
SoftLayer/CLI/loadbal/members.py: click.secho("Member {} added".format(member), fg='green')
SoftLayer/CLI/loadbal/members.py: click.secho("ERROR: {}".format(exception.faultString), fg='red')
SoftLayer/CLI/loadbal/ns_detail.py: "{}/{}".format(subnet.get('networkIdentifier'), subnet.get('cidr')),
SoftLayer/CLI/loadbal/order.py: raise exceptions.ArgumentError("{}={} is not properly formatted.".format(param, value))
SoftLayer/CLI/loadbal/order.py: raise exceptions.CLIHalt('Datacenter {} was not found'.format(datacenter))
SoftLayer/CLI/loadbal/order.py: table = formatting.KeyValueTable(['Item', 'Cost'], title="Order: {}".format(receipt.get('orderId', 'Quote')))
SoftLayer/CLI/loadbal/order.py: space = "{}/{}".format(subnet.get('networkIdentifier'), subnet.get('cidr'))
SoftLayer/CLI/loadbal/order.py: vlan = "{}.{}".format(subnet['podName'], subnet['networkVlan']['vlanNumber'])
SoftLayer/CLI/loadbal/order.py: click.secho("LB {} canceled succesfully.".format(identifier), fg='green')
SoftLayer/CLI/loadbal/order.py: click.secho("ERROR: {}".format(exception.faultString), fg='red')
SoftLayer/CLI/loadbal/pools.py: "--server needs a port and a weight. {} improperly formatted".format(server))
SoftLayer/CLI/loadbal/pools.py: click.secho("ERROR: {}".format(exception.faultString), fg='red')
SoftLayer/CLI/loadbal/pools.py: click.secho("ERROR: {}".format(exception.faultString), fg='red')
SoftLayer/CLI/loadbal/pools.py: click.secho("ERROR: {}".format(exception.faultString), fg='red')
SoftLayer/CLI/loadbal/pools.py: click.secho("ERROR: {}".format(exception.faultString), fg='red')
SoftLayer/CLI/loadbal/pools.py: click.secho("ERROR: {}".format(exception.faultString), fg='red')
metadata:
SoftLayer/CLI/metadata.py:""".format(choices="\n ".join(META_CHOICES))
order:
SoftLayer/CLI/order/lookup.py: title = "Order {id}".format(id=order.get('id'))
SoftLayer/CLI/order/lookup.py: ordered_by = "{} ({})".format(user.get('displayName'), utils.lookup(user, 'userStatus', 'name'))
SoftLayer/CLI/order/lookup.py: table.add_row(['Order Total Amount', "{price:.2f}".format(price=float(order.get('orderTotalAmount', '0')))])
SoftLayer/CLI/order/lookup.py: format(price=float(order.get('initialInvoice', {}).get('invoiceTotalAmount', '0')))])
Linked Big Issues: #1547
Child Issue: #1981
Thanks,
Ramkishor Chaladi.