MCPcopy Create free account
hub / github.com/cloudflare/cloudflared / start_cloudflared

Function start_cloudflared

component-tests/util.py:109–121  ·  view source on GitHub ↗
(directory, config, cfd_args=["run"], cfd_pre_args=["tunnel"], new_process=False,
                      allow_input=False, capture_output=True, root=False, skip_config_flag=False, expect_success=True)

Source from the content-addressed store, hash-verified

107
108
109def start_cloudflared(directory, config, cfd_args=["run"], cfd_pre_args=["tunnel"], new_process=False,
110 allow_input=False, capture_output=True, root=False, skip_config_flag=False, expect_success=True):
111
112 config_path = None
113 if not skip_config_flag:
114 config_path = write_config(directory, config.full_config)
115
116 cmd = cloudflared_cmd(config, config_path, cfd_args, cfd_pre_args, root)
117
118 if new_process:
119 return run_cloudflared_background(cmd, allow_input, capture_output)
120 # By setting check=True, it will raise an exception if the process exits with non-zero exit code
121 return subprocess.run(cmd, check=expect_success, capture_output=capture_output)
122
123def cloudflared_cmd(config, config_path, cfd_args, cfd_pre_args, root):
124 cmd = []

Callers 15

test_post_quantumMethod · 0.90
match_ruleMethod · 0.90
test_get_host_detailsMethod · 0.90
test_get_metricsMethod · 0.90
test_get_pprof_heapMethod · 0.90
test_quick_tunnelMethod · 0.90
test_quick_tunnel_urlMethod · 0.90

Calls 4

write_configFunction · 0.85
cloudflared_cmdFunction · 0.85
runMethod · 0.80

Tested by 15

test_post_quantumMethod · 0.72
match_ruleMethod · 0.72
test_get_host_detailsMethod · 0.72
test_get_metricsMethod · 0.72
test_get_pprof_heapMethod · 0.72
test_quick_tunnelMethod · 0.72
test_quick_tunnel_urlMethod · 0.72

Used in the wild real call sites across dependent graphs

searching dependent graphs…