mirror of https://github.com/docker/compose.git
Merge branch 'thomascrha-patch-1'
This commit is contained in:
commit
a7ca2d8c5f
|
@ -7,6 +7,7 @@ import operator
|
|||
from functools import reduce
|
||||
|
||||
import enum
|
||||
import six
|
||||
from docker.errors import APIError
|
||||
|
||||
from . import parallel
|
||||
|
@ -703,6 +704,8 @@ def warn_for_swarm_mode(client):
|
|||
|
||||
class NoSuchService(Exception):
|
||||
def __init__(self, name):
|
||||
if isinstance(name, six.binary_type):
|
||||
name = name.decode('utf-8')
|
||||
self.name = name
|
||||
self.msg = "No such service: %s" % self.name
|
||||
|
||||
|
|
|
@ -1,3 +1,4 @@
|
|||
# encoding: utf-8
|
||||
from __future__ import absolute_import
|
||||
from __future__ import unicode_literals
|
||||
|
||||
|
@ -14,6 +15,7 @@ from compose.const import COMPOSEFILE_V1 as V1
|
|||
from compose.const import COMPOSEFILE_V2_0 as V2_0
|
||||
from compose.const import LABEL_SERVICE
|
||||
from compose.container import Container
|
||||
from compose.project import NoSuchService
|
||||
from compose.project import Project
|
||||
from compose.service import ImageType
|
||||
from compose.service import Service
|
||||
|
@ -562,3 +564,7 @@ class ProjectTest(unittest.TestCase):
|
|||
with mock.patch('compose.project.log') as fake_log:
|
||||
project.up()
|
||||
assert fake_log.warn.call_count == 0
|
||||
|
||||
def test_no_such_service_unicode(self):
|
||||
assert NoSuchService('十六夜 咲夜'.encode('utf-8')).msg == 'No such service: 十六夜 咲夜'
|
||||
assert NoSuchService('十六夜 咲夜').msg == 'No such service: 十六夜 咲夜'
|
||||
|
|
Loading…
Reference in New Issue