Page Menu
Home
DevCentral
Search
Configure Global Search
Log In
Files
F34975267
D4112.diff
No One
Temporary
Actions
View File
Edit File
Delete File
View Transforms
Subscribe
Mute Notifications
Award Token
Flag For Later
Size
1 KB
Referenced Files
None
Subscribers
None
D4112.diff
View Options
diff --git a/_modules/network_utils.py b/_modules/network_utils.py
--- a/_modules/network_utils.py
+++ b/_modules/network_utils.py
@@ -24,7 +24,7 @@
# - ends by contiguous 0, e.g. here 0000
#
# Also, as 0.0.0.0 is invalid, the netmask must start by 1.
- return re.compile("^1+0*$").match(bits) is not None
+ return re.compile(r"^1+0*$").match(bits) is not None
def netmask_to_cidr_prefix(netmask):
diff --git a/roles/devserver/userland-software/files/shell.py b/roles/devserver/userland-software/files/shell.py
--- a/roles/devserver/userland-software/files/shell.py
+++ b/roles/devserver/userland-software/files/shell.py
@@ -132,7 +132,7 @@
def parse_variable_fragment(self, variable):
# {{%s-|bash}} means %s-, with bash as default value if we don't
# have any more argument to substitute
- matches = re.search("(.*)\|(.*)", variable)
+ matches = re.search(r"(.*)\|(.*)", variable)
if matches:
if not self.args:
return [matches.group(2)]
@@ -152,7 +152,7 @@
def parse_fragment(self, fragment):
# If the fragment is {{something}}, this is a variable to substitute.
- matches = re.search("{{(.*)}}", fragment)
+ matches = re.search(r"{{(.*)}}", fragment)
if matches:
return self.parse_variable_fragment(matches.group(1))
diff --git a/roles/salt-primary/software/files/staging-commit-message.py b/roles/salt-primary/software/files/staging-commit-message.py
--- a/roles/salt-primary/software/files/staging-commit-message.py
+++ b/roles/salt-primary/software/files/staging-commit-message.py
@@ -43,7 +43,7 @@
cwd=self.repo_path,
encoding="utf-8",
)
- matches = re.search(".*commit ([a-f0-9]*).*", output.strip())
+ matches = re.search(r".*commit ([a-f0-9]*).*", output.strip())
return matches.group(1)
def get_new_hash(self):
File Metadata
Details
Attached
Mime Type
text/plain
Expires
Mon, Jul 6, 03:33 (12 h, 11 m)
Storage Engine
blob
Storage Format
Raw Data
Storage Handle
3896221
Default Alt Text
D4112.diff (1 KB)
Attached To
Mode
D4112: Declare regular expression patterns as raw Python strings
Attached
Detach File
Event Timeline
Log In to Comment