This file contains hidden or 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
def initialize_connection(self, volume, connector, initiator_data=None): | |
"""Allow connection to connector and return connection info. | |
:param volume: The volume to be attached. | |
:param connector: Dictionary containing information about what is being | |
connected to. | |
:param initiator_data: (Optional) A dictionary of driver_initiator_data | |
objects with key-value pairs that have been | |
saved for this initiator by a driver in previous | |
initialize_connection calls. |
This file contains hidden or 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
# Test script to test using asyncio to | |
# Tail a direwolf logfile looking for RX/TX APRS packets | |
# and then convert those to APRSD Packet objects. | |
# | |
# | |
# 1) create virtualenv | |
# python -m venv .venv | |
# 2) source venv | |
# source .venv/bin/activate | |
# 3) install aprsd and async_tail |
This file contains hidden or 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
mkdir tmp | |
export TMPDIR=~/tmp | |
# rust is no longer needed with no dep on python cryptography | |
# curl --proto '=https' --tlsv1.2 -sSf https://sh.rustup.rs | sh | |
# | |
# python 3.9.x has asyncio problems which causes kiss interfaces to fail. |
This file contains hidden or 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
(.venv) waboring@devstack-train:~/cinder:(git::capacity_corrections) $ pylint cinder/tests/unit/scheduler/test_host_filters.py | |
************* Module cinder.tests.unit.scheduler.test_host_filters | |
cinder/tests/unit/scheduler/test_host_filters.py:38:8: R1725: Consider using Python 3 style super() without arguments (super-with-arguments) | |
cinder/tests/unit/scheduler/test_host_filters.py:55:8: R1725: Consider using Python 3 style super() without arguments (super-with-arguments) | |
cinder/tests/unit/scheduler/test_host_filters.py:1013:8: R1725: Consider using Python 3 style super() without arguments (super-with-arguments) | |
cinder/tests/unit/scheduler/test_host_filters.py:1105:4: W0107: Unnecessary pass statement (unnecessary-pass) | |
cinder/tests/unit/scheduler/test_host_filters.py:1226:8: R1725: Consider using Python 3 style super() without arguments (super-with-arguments) | |
----------------------------------- | |
Your code has been rated at 9.93/10 |
This file contains hidden or 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
def calculate_capacity_factors(total_capacity, free_capacity, provisioned_capacity, | |
thin_provisioning_support, max_over_subscription_ratio, | |
reserved_percentage, thin): | |
"""Create the various factors of the a particular backend. | |
Based off of definition of terms: | |
https://specs.openstack.org/openstack/cinder-specs/specs/queens/provisioning-improvements.html | |
total_capacity - The reported total capacity in the backend. |
This file contains hidden or 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
def calculate_virtual_free_capacity(total_capacity, | |
free_capacity, | |
provisioned_capacity, | |
thin_provisioning_support, | |
max_over_subscription_ratio, | |
reserved_percentage, | |
thin): | |
"""Calculate the virtual free capacity based on thin provisioning support. | |
:param total_capacity: total_capacity_gb of a host_state or pool. | |
:param free_capacity: free_capacity_gb of a host_state or pool. |
This file contains hidden or 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
filler |
This file contains hidden or 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
Cinder has calculations in the capacity filter and the Capacity weigher for determining how much free space there is. | |
https://github.com/openstack/cinder/blob/master/cinder/scheduler/filters/capacity_filter.py#L108-L159 | |
and | |
https://github.com/openstack/cinder/blob/master/cinder/scheduler/weights/capacity.py#L118-L125 | |
These 2 mechanisms turn up to having different values. | |
Take my pool stats of | |
Total Capacity 156871 | |
Allocated Capacity 144553 |
This file contains hidden or 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
aprs: | |
# Set enabled to False if there is no internet connectivity. | |
# This is useful for a direwolf KISS aprs connection only. | |
# Get the passcode for your callsign here: | |
# https://apps.magicbug.co.uk/passcode | |
enabled: true | |
host: rotate.aprs2.net | |
login: CALLSIGN | |
password: '00000' |
NewerOlder