Completed
Push — master ( 32acac...19ae40 )
by Lakshmi
11:34
created

DockerPullImageAction   A

Complexity

Total Complexity 2

Size/Duplication

Total Lines 13
Duplicated Lines 0 %

Importance

Changes 0
Metric Value
dl 0
loc 13
rs 10
c 0
b 0
f 0
wmc 2

1 Method

Rating   Name   Duplication   Size   Complexity  
A run() 0 12 2
1
from lib.base import DockerBasePythonAction
2
3
4
__all__ = [
5
    'DockerPullImageAction'
6
]
7
8
9
class DockerPullImageAction(DockerBasePythonAction):
10
    def run(self, repo, tag=None, insecure_registry=False,
11
            auth_username_override=None, auth_password_override=None):
12
        auth_override = (auth_username_override and auth_password_override)
13
14
        if auth_override:
15
            auth_config = {}
16
            auth_config['username'] = auth_username_override
17
            auth_config['password'] = auth_password_override
18
            return self.wrapper.pull(repo=repo, tag=tag, insecure_registry=insecure_registry,
19
                                     auth_config=auth_config)
20
        else:
21
            return self.wrapper.pull(repo=repo, tag=tag, insecure_registry=insecure_registry)
22