Hide Forgot
Description of problem: when I set ipv4.addresses to 1.1.1.2/24 1.1.1.1 and then go to ipv4 object and then to addresses object. after submitting change, I get: Edit 'addresses' value: { ip = 1.1.1.2/24, gw = 1.1.1.1 } so I press enter as no change or do small change wherever and then press enter and I get this: Error: failed to set 'addresses' property: '{ ip = 1.1.1.2/24' is not valid (use ip[/prefix] [gateway]) Version-Release number of selected component (if applicable): NetworkManager-0.9.9.0-9.git20130807.el7.x86_64 How reproducible: always Steps to Reproduce: 1.set ipv4.adresses 2.goto ipv4; goto addresses 3.change 4.press enter as no change Actual results: error Expected results: no error, both modes should be acceptable Additional info:
addresses and routes (and some other properties) differ in value format that is presented while printing and what user actually types. I have modified the 'change' command to present the value to the user in a format that nmcli will accept. Please review the change in upstream jklimes/rh998929-in-out-formats branch.
the use of g_regex_split() here is a little confusing, since that's intended to be used when you care about the strings in between the matches, not the matches themselves (eg, splitting on ",\\s*"). But I guess it's less code than the version with g_regex_match() would be, so... It looks like get_property_val() leaks the unconverted property value when it does a conversion. Other than that, everything looks right.
(In reply to Dan Winship from comment #3) > the use of g_regex_split() here is a little confusing, since that's intended > to be used when you care about the strings in between the matches, not the > matches themselves (eg, splitting on ",\\s*"). But I guess it's less code > than the version with g_regex_match() would be, so... Yeah, it might be misleading for the first look, but I like how it allows extracting the data quite easily. > It looks like get_property_val() leaks the unconverted property value when > it does a conversion. Other than that, everything looks right. Fixed. Pushed to upstream master: 1f6e1fbc62a6db33dd681faf2b9d8e51093eed2c
both enter and backspace + number works well. Covered by both manual and automated tests.
This request was resolved in Red Hat Enterprise Linux 7.0. Contact your manager or support representative in case you have further questions about the request.