improve regex for config changes
This commit is contained in:
@@ -196,7 +196,8 @@ func (h *Handler) processConfigChanges(configChanges string) []map[string]string
|
|||||||
// "config.memoryHotAddEnabled: true -\u003e false; \n\nconfig.cpuHotAddEnabled: true -\u003e false; \n\n"
|
// "config.memoryHotAddEnabled: true -\u003e false; \n\nconfig.cpuHotAddEnabled: true -\u003e false; \n\n"
|
||||||
// "config.hardware.device(1000).device: (2000, 2001, 2002) -> (2000, 2001, 2002, 2003);"
|
// "config.hardware.device(1000).device: (2000, 2001, 2002) -> (2000, 2001, 2002, 2003);"
|
||||||
// "config.hardware.numCPU: 2 -\u003e 1; \n\nconfig.hardware.memoryMB: 4096 -\u003e 3072;"
|
// "config.hardware.numCPU: 2 -\u003e 1; \n\nconfig.hardware.memoryMB: 4096 -\u003e 3072;"
|
||||||
re := regexp.MustCompile(`(?P<type>[^\s]+): [^-]+-[><] (?P<newValue>[^;]+);`)
|
//re := regexp.MustCompile(`(?P<type>[^\s]+): [^-]+-[><] (?P<newValue>[^;]+);`)
|
||||||
|
re := regexp.MustCompile(`(?P<type>[^\s]+): .*?+-[><] (?P<newValue>[^;]+);`)
|
||||||
|
|
||||||
// Result will hold a list of changes with type and new value
|
// Result will hold a list of changes with type and new value
|
||||||
var result []map[string]string
|
var result []map[string]string
|
||||||
|
Reference in New Issue
Block a user