Bug 1059535

Summary: System activity is updated via power form, irrespective of whether changes were actually made.
Product: [Retired] Beaker Reporter: Raymond Mancy <rmancy>
Component: web UIAssignee: Dan Callaghan <dcallagh>
Status: CLOSED CURRENTRELEASE QA Contact: tools-bugs <tools-bugs>
Severity: unspecified Docs Contact:
Priority: unspecified    
Version: 0.14CC: aigao, asaha, dcallagh, ebaak, jingwang, jzhao, qwan, rmancy, tools-bugs
Target Milestone: 19.0Keywords: Patch
Target Release: ---   
Hardware: Unspecified   
OS: Unspecified   
Whiteboard:
Fixed In Version: Doc Type: Bug Fix
Doc Text:
Story Points: ---
Clone Of: Environment:
Last Closed: 2014-11-25 07:18:20 UTC Type: Bug
Regression: --- Mount Type: ---
Documentation: --- CRM:
Verified Versions: Category: ---
oVirt Team: --- RHEL 7.3 requirements from Atomic Host:
Cloudforms Team: --- Target Upstream Version:
Embargoed:
Bug Depends On: 1070036    
Bug Blocks:    

Description Raymond Mancy 2014-01-30 05:37:17 UTC
Description of problem:

See title

Version-Release number of selected component (if applicable):


How reproducible:

Always

Steps to Reproduce:
1. Go to power config page of system form. Change nothing
2. Click on 'Save Power Changes'
3.

Actual results:

'Updated Power' appears as a flash message
 Three new entries are added, one for each of:
  * reprovision_distro_tree
  * release_action
  * power_type

The above will repeat on successive clicks of 'Save Power Changes'.

Expected results:

No flash message, no addition to the system activity logs.

Additional info:

Comment 2 Raymond Mancy 2014-01-30 06:49:21 UTC
There are a couple of issues here. The issue with the power type is simple, it's comparing a string and an int on the controller code. 

The reprovision distro and release action are not even checked as to whether or not there has been a change. Even once the code is changed so that they are checked, we should probably be supplying a default (if there is one available in the case of the distro) so we don't get the 'None -> 'PowerOff' etc.

Comment 3 Dan Callaghan 2014-03-03 06:44:26 UTC
This is fixed by the patch for bug 1070036: http://gerrit.beaker-project.org/2865

Comment 4 Dan Callaghan 2014-09-18 05:44:14 UTC
This was merged to develop as part of the new-system-page branch.

Comment 7 Dan Callaghan 2014-09-24 08:26:47 UTC
(In reply to xuezhi ma from comment #6)
> Whether we not format the '' before compare it with system.power.power_user?
> if 'power_user' in data and data['power_user'] != system.power.power_user:

Right, we are treating None (NULL) distinct from '' (empty string), and so we are logging it as a change even if you just save the form leaving the fields empty.

http://gerrit.beaker-project.org/3349

Comment 10 Dan Callaghan 2014-11-25 07:18:20 UTC
Beaker 19.0 has been released.