浏览代码

Makes Service.config_hash a property

Signed-off-by: Frank Sachsenheim <[email protected]>
Frank Sachsenheim 10 年之前
父节点
当前提交
dd738b380b
共有 1 个文件被更改,包括 3 次插入2 次删除
  1. 3 2
      compose/service.py

+ 3 - 2
compose/service.py

@@ -343,7 +343,7 @@ class Service(object):
         config_hash = None
 
         try:
-            config_hash = self.config_hash()
+            config_hash = self.config_hash
         except NoSuchImageError as e:
             log.debug(
                 'Service %s has diverged: %s',
@@ -468,6 +468,7 @@ class Service(object):
             else:
                 numbers.add(c.number)
 
+    @property
     def config_hash(self):
         return json_hash(self.config_dict())
 
@@ -585,7 +586,7 @@ class Service(object):
             container_options['name'] = self.get_container_name(number, one_off)
 
         if add_config_hash:
-            config_hash = self.config_hash()
+            config_hash = self.config_hash
             if 'labels' not in container_options:
                 container_options['labels'] = {}
             container_options['labels'][LABEL_CONFIG_HASH] = config_hash