MCPcopy Create free account
hub / github.com/apache/cloudstack / search

Method search

systemvm/debian/opt/cloud/bin/cs/CsFile.py:133–149  ·  view source on GitHub ↗
(self, search, replace)

Source from the content-addressed store, hash-verified

131 return False
132
133 def search(self, search, replace):
134 found = False
135 replace_filtered = replace
136 if re.search("PSK \"", replace):
137 replace_filtered = re.sub(r'".*"', '"****"', replace)
138 logging.debug("Searching for %s and replacing with %s" % (search, replace_filtered))
139 for index, line in enumerate(self.new_config):
140 if line.lstrip().startswith("#"):
141 continue
142 if re.search(search, line):
143 found = True
144 if replace not in line:
145 self.new_config[index] = replace + "\n"
146 if not found:
147 self.new_config.append(replace + "\n")
148 return True
149 return False
150
151 def searchString(self, search, ignoreLinesStartWith):
152 found = False

Callers 5

configure_ipsecMethod · 0.95
configure_l2tpIpsecMethod · 0.95
setupMethod · 0.95
_redundant_onMethod · 0.95
addeqMethod · 0.95

Calls 3

debugMethod · 0.80
searchMethod · 0.65
appendMethod · 0.45

Tested by

no test coverage detected