Revision 24a5c9e6 src/oca/ruby/opennebula/group.rb

View differences:

src/oca/ruby/opennebula/group.rb
142 142

  
143 143
            if OpenNebula.is_error?(rc)
144 144
                self.delete
145
                error_msg =  "Error creating admin group: #{rc.message}"
145
                error_msg =  "Error creating admin user: #{rc.message}"
146 146
                return OpenNebula::Error.new(error_msg)
147 147
            end
148 148

  
149
            # Add default Sunstone views for the group
149
            str = ""
150
            update = false
151

  
152
            # Add Sunstone views for the group
150 153
            if group_hash[:views]
151
                str = "SUNSTONE_VIEWS=\"#{group_hash[:views].join(",")}\"\n"
154
                str += "SUNSTONE_VIEWS=\"#{group_hash[:views].join(",")}\"\n"
155
                update = true
156
            end
157

  
158
            # Add Sunstone views for the group
159
            if group_hash[:default_view]
160
                str += "DEFAULT_VIEW=\"#{group_hash[:default_view]}\"\n"
161
                update = true
162
            end
163

  
164
            if update
152 165
                self.update(str, true)
153 166
            end
154 167

  
......
319 332
                return rc
320 333
            end
321 334

  
335
            # Set the default admin view to vdcadmin
336
            group_admin.update("DEFAULT_VIEW=#{GROUP_ADMIN_SUNSTONE_VIEWS}", true)
337

  
322 338
            #Create admin group acls
323 339
            acls = Array.new
324 340

  

Also available in: Unified diff