diff --git a/src/pylorax/api/recipes.py b/src/pylorax/api/recipes.py index c0ab55b4..a3f5fbde 100644 --- a/src/pylorax/api/recipes.py +++ b/src/pylorax/api/recipes.py @@ -1044,11 +1044,9 @@ def get_commit_details(commit, revision=None): datetime = sig.get_time() # XXX What do we do with timezone? _timezone = sig.get_time_zone() - timeval = GLib.TimeVal() - ok = datetime.to_timeval(timeval) - if not ok: + time_str = datetime.format_iso8601() + if not time_str: raise CommitTimeValError - time_str = timeval.to_iso8601() return CommitDetails(commit_str, time_str, message, revision) diff --git a/tests/pylorax/test_recipes.py b/tests/pylorax/test_recipes.py index 58b83b02..5c4a1e74 100644 --- a/tests/pylorax/test_recipes.py +++ b/tests/pylorax/test_recipes.py @@ -681,7 +681,7 @@ hostname = "testing-bad-recipe" def test_03_list_commits_commit_time_val_error(self): """Test listing recipe commits which raise CommitTimeValError""" - with mock.patch('pylorax.api.recipes.GLib.DateTime.to_timeval', return_value=False): + with mock.patch('pylorax.api.recipes.GLib.DateTime.format_iso8601', return_value=False): commits = recipes.list_commits(self.repo, "master", "test-recipe.toml") self.assertEqual(len(commits), 0, "Wrong number of commits.")