mirror of
https://github.com/altlinux/gpupdate.git
synced 2025-03-21 18:50:38 +03:00
util/util.py: added new function string_to_literal_evalgit
This commit is contained in:
parent
2567bb9c45
commit
21b4ced721
@ -23,6 +23,7 @@ import subprocess
|
||||
import re
|
||||
from pathlib import Path
|
||||
from .samba import smbopts
|
||||
import ast
|
||||
|
||||
|
||||
def get_machine_name():
|
||||
@ -180,3 +181,9 @@ def get_policy_variants():
|
||||
|
||||
return general_listing
|
||||
|
||||
def string_to_literal_eval(string):
|
||||
try:
|
||||
literaleval = ast.literal_eval(string)
|
||||
except:
|
||||
literaleval = string
|
||||
return literaleval
|
||||
|
Loading…
x
Reference in New Issue
Block a user