Skip to content

Commit

Permalink
Fixed an issue where following symlinks on Paths no longer works, fix…
Browse files Browse the repository at this point in the history
…ed an issue where django tests weren't correctly building output, restored some type hinting on an enum, and fixed some merge errors
  • Loading branch information
christophertubbs authored and aaraney committed Jan 25, 2024
1 parent b3941a9 commit 76809da
Show file tree
Hide file tree
Showing 4 changed files with 6 additions and 8 deletions.
3 changes: 2 additions & 1 deletion python/gui/maas_experiment/application_values.py
Original file line number Diff line number Diff line change
Expand Up @@ -117,7 +117,8 @@ def get_full_localtimezone():

# If this is a system with 'zoneinfo' set up as part of the environment, parse the name from the linked zone
zone_path = Path("/etc/localtime")
zone_path = str(zone_path.readlink()) if zone_path.exists() and zone_path.is_symlink() else ""
zone_path = zone_path.resolve()
zone_path = str(zone_path) if zone_path.exists() else ""

# We can predict the path if the zone is linked to a file under 'zoneinfo'.
if 'zoneinfo' in zone_path:
Expand Down
2 changes: 1 addition & 1 deletion python/lib/core/dmod/core/common/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,7 @@
from .types import TextValues


class Status(CommonEnum):
class Status(str, CommonEnum):
"""
Very basic enumeration used to describe the status of something
"""
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -61,7 +61,6 @@ def __call__(self, *args: _T, **kwargs: _V) -> typing.Union[_MODEL_TYPE, typing.


def wrapper_caller(
function: typing.Callable[[typing.Any, ...], typing.Union[_MODEL_TYPE, QuerySet[_MODEL_TYPE]]],
function: wrapper_fn[_T, _V],
_wrapper_return_values: WrapperResults,
args: typing.Sequence[_T],
Expand Down Expand Up @@ -114,10 +113,6 @@ def __call_wrapper(
*args: _T,
**kwargs: _V,
) -> typing.Union[_MODEL_TYPE, typing.Sequence[_MODEL_TYPE]]:
function: typing.Callable[[typing.Any, ...], typing.Union[_MODEL_TYPE, QuerySet[_MODEL_TYPE]]],
*args,
**kwargs
) -> typing.Union[_MODEL_TYPE, typing.List[_MODEL_TYPE]]:
results = WrapperResults()

if self.__can_use_concurrency:
Expand Down
4 changes: 3 additions & 1 deletion scripts/test_django.py
Original file line number Diff line number Diff line change
Expand Up @@ -347,8 +347,10 @@ def __interpret_stderr(self):
# separated from the previously read
if current_description:
current_description += os.linesep
current_description += line
else:
current_description = line

current_description += line
# Otherwise, we want to just tack the read data onto the content of the message we're building
else:
# If we're on the final line of the messages, just tack on a new line to our content,
Expand Down

0 comments on commit 76809da

Please sign in to comment.