Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Ust 3296/implem 3297/add columns search result machine type #131

Conversation

VinceMacBuche
Copy link
Member

Linked to http://www.rudder-project.org/redmine/issues/3297

Not finished yet, but now we get the machine type with a workaround

Maybe we need to change the way node informations are stored.

@@ -234,6 +234,17 @@ class ReportsJdbcRepository(jdbcTemplate : JdbcTemplate) extends ReportsReposito
}
}

def getNewestReportOnNode(nodeid:NodeId) : Box[Option[Reports]] = {
jdbcTemplate.query(baseQuery + s" and nodeid = '${nodeid.value}' order by executionDate desc limit 1",
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This is something that hsould never ever be done; as it is a risk for potential SQL injection (imagine a Node with the id '; delete from ruddersysevents; --
You should use the more traditionnal with a prepared statement
jdbcTemplate.query(query,
array.toArray[AnyRef],
ReportsMapper).toSeq;

@ncharles
Copy link
Member

Appart from the OsType which is not used anymore, but that we can keep anyway, it's great

nperron pushed a commit that referenced this pull request Mar 28, 2013
…olumns_search_result_machine_type

Fixes #3297 : Add new columns to search node result (os details/ last report)
@nperron nperron merged commit d9adfa0 into Normation:master Mar 28, 2013
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
3 participants