Skip to content
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

Dev #469

Merged
merged 10 commits into from
Feb 14, 2024
Merged

Dev #469

Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion .pre-commit-config.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@ repos:

- repo: https://github.com/psf/black-pre-commit-mirror

rev: 24.1.1
rev: 24.2.0
hooks:
- id: black
language_version: python3.11
Expand Down
2 changes: 1 addition & 1 deletion docker-compose.bibigrid.yml
Original file line number Diff line number Diff line change
Expand Up @@ -41,7 +41,7 @@ services:

# filebeat
simplevm_filebeat:
image: docker.elastic.co/beats/filebeat:8.12.0
image: docker.elastic.co/beats/filebeat:8.12.1
env_file:
- .env
volumes:
Expand Down
2 changes: 1 addition & 1 deletion docker-compose.host.yml
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,7 @@ services:

simplevm_client_filebeat:
container_name: simplevm_client_filebeat
image: docker.elastic.co/beats/filebeat:8.12.0
image: docker.elastic.co/beats/filebeat:8.12.1
env_file:
- .env
volumes:
Expand Down
2 changes: 1 addition & 1 deletion docker-compose.yml
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,7 @@ services:
# filebeat
simplevm_client_filebeat:
container_name: simplevm_client_filebeat
image: docker.elastic.co/beats/filebeat:8.12.0
image: docker.elastic.co/beats/filebeat:8.12.1
env_file:
- .env
volumes:
Expand Down
8 changes: 4 additions & 4 deletions requirements.txt
Original file line number Diff line number Diff line change
@@ -1,18 +1,18 @@
setuptools==69.0.3
setuptools==69.1.0
thrift==0.16.0
python-keystoneclient==5.3.0
openstacksdk==2.1.0
deprecated==1.2.14
Click==8.1.7
ansible==9.1.0
ansible==9.2.0
flake8==7.0.0
paramiko==3.4.0
ruamel.yaml==0.18.5
ruamel.yaml==0.18.6
pyvim==3.0.3
redis==5.0.1
requests==2.31.0
pyyaml==6.0.1
pre-commit==3.6.0
pre-commit==3.6.1
types-PyYAML==6.0.12.12
sympy==1.12
types-redis==4.6.0.20240106
20 changes: 14 additions & 6 deletions simple_vm_client/openstack_connector/openstack_connector.py
Original file line number Diff line number Diff line change
Expand Up @@ -459,17 +459,23 @@ def netcat(self, host: str, port: int) -> bool:
logger.info(f"Checking SSH Connection {host}:{port} Result = {r}")
return r == 0

def get_flavor(self, name_or_id: str) -> Flavor:
def get_flavor(self, name_or_id: str, ignore_error: bool = False) -> Flavor:
logger.info(f"Get flavor {name_or_id}")

flavor: Flavor = self.openstack_connection.get_flavor(
name_or_id=name_or_id, get_extra=True
)

if flavor is None:
logger.exception(f"Flavor {name_or_id} not found!")
raise FlavorNotFoundException(
message=f"Flavor {name_or_id} not found!", name_or_id=name_or_id
)
logger.error(f"Flavor {name_or_id} not found!")

if not ignore_error:
raise FlavorNotFoundException(
message=f"Flavor {name_or_id} not found!", name_or_id=name_or_id
)
else:
return Flavor()

return flavor

def get_flavors(self) -> list[Flavor]:
Expand Down Expand Up @@ -1014,7 +1020,9 @@ def get_server(self, openstack_id: str) -> Server:
ignore_not_found=True,
)

server.flavor = self.get_flavor(name_or_id=server.flavor["id"])
server.flavor = self.get_flavor(
name_or_id=server.flavor["id"], ignore_error=True
)

return server
except OpenStackCloudException as e:
Expand Down
Loading