fabric / fabric

Compare 0f9e693 ... +40 ... 018367c

No flags found

Use flags to group coverage reports by test type, project and/or folders.
Then setup custom commit statuses and notifications for each flag.

e.g., #unittest #integration

#production #enterprise

#frontend #backend

Learn more about Codecov Flags here.


@@ -1,2 +1,2 @@
Loading
1 -
__version_info__ = (2, 4, 0)
1 +
__version_info__ = (2, 5, 0)
2 2
__version__ = ".".join(map(str, __version_info__))

@@ -23,10 +23,6 @@
Loading
23 23
    def core_args(self):
24 24
        core_args = super(Fab, self).core_args()
25 25
        my_args = [
26 -
            Argument(
27 -
                names=("S", "ssh-config"),
28 -
                help="Path to runtime SSH config file.",
29 -
            ),
30 26
            Argument(
31 27
                names=("H", "hosts"),
32 28
                help="Comma-separated host name(s) to execute tasks against.",
@@ -49,6 +45,15 @@
Loading
49 45
                kind=bool,
50 46
                help="Request an upfront SSH key passphrase prompt.",
51 47
            ),
48 +
            Argument(
49 +
                names=("S", "ssh-config"),
50 +
                help="Path to runtime SSH config file.",
51 +
            ),
52 +
            Argument(
53 +
                names=("t", "connect-timeout"),
54 +
                kind=int,
55 +
                help="Specifies default connection timeout, in seconds.",
56 +
            ),
52 57
        ]
53 58
        return core_args + my_args
54 59
@@ -120,6 +125,10 @@
Loading
120 125
        path = self.args["identity"].value
121 126
        if path:
122 127
            connect_kwargs["key_filename"] = path
128 +
        # Ditto for connect timeout
129 +
        timeout = self.args["connect-timeout"].value
130 +
        if timeout:
131 +
            connect_kwargs["timeout"] = timeout
123 132
        # Secrets prompts that want to happen at handoff time instead of
124 133
        # later/at user-time.
125 134
        # TODO: should this become part of Invoke proper in case other

@@ -25,6 +25,14 @@
Loading
25 25
        """
26 26
        Normalize mixed host-strings-or-kwarg-dicts into kwarg dicts only.
27 27
28 +
        In other words, transforms data taken from the CLI (--hosts, always
29 +
        strings) or decorator arguments (may be strings or kwarg dicts) into
30 +
        kwargs suitable for creating Connection instances.
31 +
32 +
        Subclasses may wish to override or extend this to perform, for example,
33 +
        database or custom config file lookups (vs this default behavior, which
34 +
        is to simply assume that strings are 'host' kwargs).
35 +
28 36
        :param hosts:
29 37
            Potentially heterogenous list of host connection values, as per the
30 38
            ``hosts`` param to `.task`.
@@ -80,10 +88,7 @@
Loading
80 88
                )
81 89
82 90
            def anonymous(c):
83 -
                # TODO: how to make all our tests configure in_stream=False?
84 -
                # TODO: doesn't this preclude users wanting to submit stdin to
85 -
                # remainder commands?
86 -
                c.run(self.core.remainder, in_stream=False)
91 +
                c.run(self.core.remainder)
87 92
88 93
            anon = Call(Task(body=anonymous))
89 94
            # TODO: see above TODOs about non-parameterized setups, roles etc

@@ -32,7 +32,7 @@
Loading
32 32
        self.inline_env = kwargs.pop("inline_env", None)
33 33
        super(Remote, self).__init__(*args, **kwargs)
34 34
35 -
    def start(self, command, shell, env):
35 +
    def start(self, command, shell, env, timeout=None):
36 36
        self.channel = self.context.create_session()
37 37
        if self.using_pty:
38 38
            rows, cols = pty_size()
@@ -55,8 +55,6 @@
Loading
55 55
                command = "export {} && {}".format(parameters, command)
56 56
            else:
57 57
                self.channel.update_environment(env)
58 -
        # TODO: pass in timeout= here when invoke grows timeout functionality
59 -
        # in Runner/Local.
60 58
        self.channel.exec_command(command)
61 59
62 60
    def read_proc_stdout(self, num_bytes):
@@ -68,6 +66,9 @@
Loading
68 66
    def _write_proc_stdin(self, data):
69 67
        return self.channel.sendall(data)
70 68
69 +
    def close_proc_stdin(self):
70 +
        return self.channel.shutdown_write()
71 +
71 72
    @property
72 73
    def process_is_finished(self):
73 74
        return self.channel.exit_status_ready()
@@ -99,8 +100,15 @@
Loading
99 100
        if hasattr(self, "channel"):
100 101
            self.channel.close()
101 102
103 +
    def kill(self):
104 +
        # Just close the channel immediately, which is about as close as we can
105 +
        # get to a local SIGKILL unfortunately.
106 +
        # TODO: consider _also_ calling .send_interrupt() and only doing this
107 +
        # after another few seconds; but A) kinda fragile/complex and B) would
108 +
        # belong in invoke.Runner anyways?
109 +
        self.channel.close()
110 +
102 111
    # TODO: shit that is in fab 1 run() but could apply to invoke.Local too:
103 -
    # * command timeout control
104 112
    # * see rest of stuff in _run_command/_execute in operations.py...there is
105 113
    # a bunch that applies generally like optional exit codes, etc
106 114

Everything is accounted for!

No changes detected that need to be reviewed.
What changes does Codecov check for?
Lines, not adjusted in diff, that have changed coverage data.
Files that introduced coverage data that had none before.
Files that have missing coverage data that once were tracked.

42 Commits

Hiding 1 contexual commits Hiding 2 contexual commits
new
Hiding 6 contexual commits Hiding 1 contexual commits Hiding 3 contexual commits Hiding 6 contexual commits Hiding 2 contexual commits
Files Coverage
fabric -0.06% 93.29%
Project Totals (16 files) 93.29%
Loading