cqi / freshmaker

Forked from freshmaker 7 years ago
Clone

5684157 Convert frequent used image properties to real ContainerImage properties

Authored and Committed by cqi 4 years ago
    Convert frequent used image properties to real ContainerImage properties
    
    An image's name, version and parent are accessed frequently by parsing
    from ContainerImage.nvr and key parent. This change proposed a new way
    to access these properties by making properties of ContainerImage, e.g.
    ContainerImage.name and ContainerImage.parent. With these changes, the
    original code becomes shorter and less calls to the function to parse
    N-V-R from an image's brew build NVR.
    
    This proposed change removes an interface ContainerImage.create that I
    wrote before. After reviewing this piece of code again, I feel it's
    useless. Instead, a normal construction just works well. For example to
    initiate an image object, the code could be:
    
      image = ContainerImage({'brew': {'build': 'n-v-r'}})
    
    Signed-off-by: Chenxiong Qi <cqi@redhat.com>
    
        
file modified
+46 -28
file modified
+50 -50
file modified
+1 -1