Possible bug

Hi,

I believe I've found a potential bug. This is with Foreman 1.8.2 on CentOS
7.1.

If you create a global parameter with a period character, you are then
unable to modify or delete it.

For example, I created a param called "net.ifnames". When I try to edit it:

Started GET "/common_parameters/net.ifnames/edit" for 10.44.249.224 at
2015-07-28 10:16:30 +0100
2015-07-28 10:16:30 [F]
ActionController::RoutingError (No route matches [GET]
"/common_parameters/net.ifnames/edit"):

/usr/share/gems/gems/passenger-4.0.18/lib/phusion_passenger/rack/thread_handler_extension.rb:77:in
`process_request'

/usr/share/gems/gems/passenger-4.0.18/lib/phusion_passenger/request_handler/thread_handler.rb:140:in
`accept_and_process_next_request'

/usr/share/gems/gems/passenger-4.0.18/lib/phusion_passenger/request_handler/thread_handler.rb:108:in
`main_loop'

/usr/share/gems/gems/passenger-4.0.18/lib/phusion_passenger/request_handler.rb:441:in
`block (3 levels) in start_threads'

Trying to delete it:
Started DELETE "/common_parameters/net.ifnames" for 10.44.249.224 at
2015-07-28 10:17:06 +0100
2015-07-28 10:17:06 [I] Processing by CommonParametersController#destroy as
2015-07-28 10:17:06 [I] Parameters: {"authenticity_token"=>"xxxx",
"id"=>"net"}
2015-07-28 10:17:06 [I] Completed 406 Not Acceptable in 7ms (ActiveRecord:
1.1ms)
2015-07-28 10:17:21 [I]

I guess it's the validation that should be changed to prevent me from
creating a variable with a period char in it.

Can anyone help with removing this param?

J

Thanks.

In the end I just deleted it from the postgres db.

I'll raise it as a bug.

> Hi,
>
> I believe I've found a potential bug. This is with Foreman 1.8.2 on
> CentOS 7.1.
>
> If you create a global parameter with a period character, you are then
> unable to modify or delete it.
>
> For example, I created a param called "net.ifnames". When I try to edit it:
>
> Started GET "/common_parameters/net.ifnames/edit" for 10.44.249.224 at
> 2015-07-28 10:16:30 +0100
> 2015-07-28 10:16:30 [F]
> ActionController::RoutingError (No route matches [GET]
> "/common_parameters/net.ifnames/edit"):
> …
>
>
> I guess it's the validation that should be changed to prevent me from
> creating a variable with a period char in it.

Yeah, though preferably we'd support it but fix the web UI. Please do
file this as a bug in Foreman.

> Can anyone help with removing this param?

I'd suggest using hammer, e.g. hammer global-parameter list and delete.

··· On 28/07/15 10:18, jamese wrote:


Dominic Cleal
Red Hat Engineering