mirror of
https://github.com/saltstack/salt.git
synced 2025-04-17 10:10:20 +00:00
Merge pull request #28231 from rallytime/fix-28227
Make sure we're compairing strings when getting images in the DO driver
This commit is contained in:
commit
570e7faa3b
1 changed files with 5 additions and 1 deletions
|
@ -34,7 +34,7 @@ import pprint
|
|||
import logging
|
||||
import decimal
|
||||
|
||||
# Import Salt Cloud Libs
|
||||
# Import Salt Libs
|
||||
import salt.utils.cloud
|
||||
import salt.config as config
|
||||
from salt.exceptions import (
|
||||
|
@ -44,6 +44,7 @@ from salt.exceptions import (
|
|||
SaltCloudExecutionFailure,
|
||||
SaltCloudExecutionTimeout
|
||||
)
|
||||
from salt.ext.six import string_types
|
||||
|
||||
# Import Third Party Libs
|
||||
try:
|
||||
|
@ -207,6 +208,9 @@ def get_image(vm_):
|
|||
vm_image = config.get_cloud_config_value(
|
||||
'image', vm_, __opts__, search_global=False
|
||||
)
|
||||
if not isinstance(vm_image, string_types):
|
||||
vm_image = str(vm_image)
|
||||
|
||||
for image in images:
|
||||
if vm_image in (images[image]['name'], images[image]['slug'], images[image]['id']):
|
||||
if images[image]['slug'] is not None:
|
||||
|
|
Loading…
Add table
Reference in a new issue