Skip to content

Commit

Permalink
pre-commit: check more file types for trailing whitespace (#9352)
Browse files Browse the repository at this point in the history
  • Loading branch information
jbampton authored Jul 10, 2024
1 parent 806692b commit 9f1577d
Show file tree
Hide file tree
Showing 90 changed files with 347 additions and 346 deletions.
3 changes: 2 additions & 1 deletion .pre-commit-config.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -59,8 +59,9 @@ repos:
- id: mixed-line-ending
exclude: \.(cs|xml)$
- id: trailing-whitespace
files: \.(in|java|md|py|rb|sh|vue|yaml|yml)$
files: \.(header|in|java|md|properties|py|rb|sh|sql|txt|vue|yaml|yml)$
args: [--markdown-linebreak-ext=md]
exclude: ^services/console-proxy/rdpconsole/src/test/doc/freerdp-debug-log\.txt$
- repo: https://github.com/pycqa/flake8
rev: 7.0.0
hooks:
Expand Down
4 changes: 2 additions & 2 deletions build/replace.properties
Original file line number Diff line number Diff line change
Expand Up @@ -5,9 +5,9 @@
# to you under the Apache License, Version 2.0 (the
# "License"); you may not use this file except in compliance
# with the License. You may obtain a copy of the License at
#
#
# http://www.apache.org/licenses/LICENSE-2.0
#
#
# Unless required by applicable law or agreed to in writing,
# software distributed under the License is distributed on an
# "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -5,9 +5,9 @@
-- to you under the Apache License, Version 2.0 (the
-- "License"); you may not use this file except in compliance
-- with the License. You may obtain a copy of the License at
--
--
-- http://www.apache.org/licenses/LICENSE-2.0
--
--
-- Unless required by applicable law or agreed to in writing,
-- software distributed under the License is distributed on an
-- "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
Expand Down
12 changes: 6 additions & 6 deletions engine/schema/src/main/resources/META-INF/db/schema-20to21.sql
Original file line number Diff line number Diff line change
Expand Up @@ -5,9 +5,9 @@
-- to you under the Apache License, Version 2.0 (the
-- "License"); you may not use this file except in compliance
-- with the License. You may obtain a copy of the License at
--
--
-- http://www.apache.org/licenses/LICENSE-2.0
--
--
-- Unless required by applicable law or agreed to in writing,
-- software distributed under the License is distributed on an
-- "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
Expand Down Expand Up @@ -141,14 +141,14 @@ ALTER TABLE `cloud`.`host` ADD COLUMN `cluster_id` bigint unsigned;

--
-- enforced in postporcess-20to21.sql
ALTER TABLE `cloud`.`host_pod_ref` ADD COLUMN `gateway` varchar(255); -- need to migrage data with user input
ALTER TABLE `cloud`.`host_pod_ref` ADD COLUMN `gateway` varchar(255); -- need to migrage data with user input

ALTER TABLE `cloud`.`service_offering` ADD COLUMN `recreatable` tinyint(1) unsigned NOT NULL DEFAULT 0;
ALTER TABLE `cloud`.`service_offering` ADD COLUMN `recreatable` tinyint(1) unsigned NOT NULL DEFAULT 0;
ALTER TABLE `cloud`.`service_offering` ADD COLUMN `tags` varchar(255);

ALTER TABLE `cloud`.`user_vm` MODIFY COLUMN `domain_router_id` bigint unsigned; -- change from NOT NULL to NULL
ALTER TABLE `cloud`.`user_vm` MODIFY COLUMN `domain_router_id` bigint unsigned; -- change from NOT NULL to NULL

ALTER TABLE `cloud`.`event` ADD COLUMN `state` varchar(32) NOT NULL DEFAULT 'Completed';
ALTER TABLE `cloud`.`event` ADD COLUMN `state` varchar(32) NOT NULL DEFAULT 'Completed';
ALTER TABLE `cloud`.`event` ADD COLUMN `start_id` bigint unsigned NOT NULL DEFAULT 0;

ALTER TABLE `cloud`.`disk_offering` ADD COLUMN `tags` varchar(4096);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -5,9 +5,9 @@
-- to you under the Apache License, Version 2.0 (the
-- "License"); you may not use this file except in compliance
-- with the License. You may obtain a copy of the License at
--
--
-- http://www.apache.org/licenses/LICENSE-2.0
--
--
-- Unless required by applicable law or agreed to in writing,
-- software distributed under the License is distributed on an
-- "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -5,9 +5,9 @@
-- to you under the Apache License, Version 2.0 (the
-- "License"); you may not use this file except in compliance
-- with the License. You may obtain a copy of the License at
--
--
-- http://www.apache.org/licenses/LICENSE-2.0
--
--
-- Unless required by applicable law or agreed to in writing,
-- software distributed under the License is distributed on an
-- "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -5,9 +5,9 @@
-- to you under the Apache License, Version 2.0 (the
-- "License"); you may not use this file except in compliance
-- with the License. You may obtain a copy of the License at
--
--
-- http://www.apache.org/licenses/LICENSE-2.0
--
--
-- Unless required by applicable law or agreed to in writing,
-- software distributed under the License is distributed on an
-- "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
Expand Down Expand Up @@ -50,7 +50,7 @@ CREATE TABLE `cloud_usage`.`usage_event` (
`resource_name` varchar(255),
`offering_id` bigint unsigned,
`template_id` bigint unsigned,
`size` bigint unsigned,
`size` bigint unsigned,
`processed` tinyint NOT NULL default '0',
PRIMARY KEY (`id`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8;
Expand Down
28 changes: 14 additions & 14 deletions engine/schema/src/main/resources/META-INF/db/schema-21to22.sql
Original file line number Diff line number Diff line change
Expand Up @@ -5,9 +5,9 @@
-- to you under the Apache License, Version 2.0 (the
-- "License"); you may not use this file except in compliance
-- with the License. You may obtain a copy of the License at
--
--
-- http://www.apache.org/licenses/LICENSE-2.0
--
--
-- Unless required by applicable law or agreed to in writing,
-- software distributed under the License is distributed on an
-- "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
Expand All @@ -22,7 +22,7 @@ ALTER TABLE `cloud`.`cluster` ADD COLUMN `guid` varchar(255) UNIQUE DEFAULT NULL
ALTER TABLE `cloud`.`cluster` ADD COLUMN `cluster_type` varchar(64) DEFAULT 'CloudManaged';
ALTER TABLE `cloud`.`vm_template` ADD COLUMN `hypervisor_type` varchar(32) COMMENT 'hypervisor that the template is belonged to';
ALTER TABLE `cloud`.`vm_template` ADD COLUMN `extractable` int(1) unsigned NOT NULL default 0 COMMENT 'Is this template extractable';
ALTER TABLE `cloud`.`template_spool_ref` ADD CONSTRAINT `fk_template_spool_ref__template_id` FOREIGN KEY (`template_id`) REFERENCES `vm_template`(`id`);
ALTER TABLE `cloud`.`template_spool_ref` ADD CONSTRAINT `fk_template_spool_ref__template_id` FOREIGN KEY (`template_id`) REFERENCES `vm_template`(`id`);

ALTER TABLE `cloud`.`guest_os` modify `name` varchar(255) ;

Expand Down Expand Up @@ -104,7 +104,7 @@ CREATE TABLE `cloud`.`networks` (
`broadcast_domain_type` varchar(32) NOT NULL COMMENT 'type of broadcast domain used',
`broadcast_uri` varchar(255) COMMENT 'broadcast domain specifier',
`gateway` varchar(15) COMMENT 'gateway for this network configuration',
`cidr` varchar(18) COMMENT 'network cidr',
`cidr` varchar(18) COMMENT 'network cidr',
`mode` varchar(32) COMMENT 'How to retrieve ip address in this network',
`network_offering_id` bigint unsigned NOT NULL COMMENT 'network offering id that this configuration is created from',
`data_center_id` bigint unsigned NOT NULL COMMENT 'data center id that this configuration is used in',
Expand Down Expand Up @@ -167,7 +167,7 @@ CREATE TABLE `cloud`.`nics` (
`ip_type` varchar(32) COMMENT 'type of ip',
`broadcast_uri` varchar(255) COMMENT 'broadcast uri',
`network_id` bigint unsigned NOT NULL COMMENT 'network configuration id',
`mode` varchar(32) COMMENT 'mode of getting ip address',
`mode` varchar(32) COMMENT 'mode of getting ip address',
`state` varchar(32) NOT NULL COMMENT 'state of the creation',
`strategy` varchar(32) NOT NULL COMMENT 'reservation strategy',
`reserver_name` varchar(255) COMMENT 'Name of the component that reserved the ip address',
Expand All @@ -176,7 +176,7 @@ CREATE TABLE `cloud`.`nics` (
`update_time` timestamp NOT NULL COMMENT 'time the state was changed',
`isolation_uri` varchar(255) COMMENT 'id for isolation',
`ip6_address` char(40) COMMENT 'ip6 address',
`default_nic` tinyint NOT NULL COMMENT "None",
`default_nic` tinyint NOT NULL COMMENT "None",
`created` datetime NOT NULL COMMENT 'date created',
`removed` datetime COMMENT 'date removed if not null',
PRIMARY KEY (`id`),
Expand Down Expand Up @@ -253,23 +253,23 @@ CREATE TABLE `cloud`.`op_host` (
`id` bigint unsigned NOT NULL UNIQUE COMMENT 'host id',
`sequence` bigint unsigned DEFAULT 1 NOT NULL COMMENT 'sequence for the host communication',
PRIMARY KEY (`id`),
CONSTRAINT `fk_op_host__id` FOREIGN KEY (`id`) REFERENCES `host`(`id`) ON DELETE CASCADE
CONSTRAINT `fk_op_host__id` FOREIGN KEY (`id`) REFERENCES `host`(`id`) ON DELETE CASCADE
) ENGINE = InnoDB DEFAULT CHARSET=utf8;

CREATE TABLE `cloud`.`guest_os_hypervisor` (
`id` bigint unsigned NOT NULL auto_increment,
`hypervisor_type` varchar(32) NOT NULL,
`guest_os_name` varchar(255) NOT NULL,
`guest_os_id` bigint unsigned NOT NULL,
PRIMARY KEY (`id`)
PRIMARY KEY (`id`)
) ENGINE=InnoDB AUTO_INCREMENT=1 DEFAULT CHARSET=utf8;

INSERT INTO op_host(id, sequence) select id, sequence from host;

-- Alter Tables to add Columns;

ALTER TABLE `cloud`.`cluster` ADD COLUMN `hypervisor_type` varchar(32);
UPDATE `cloud`.`cluster` SET hypervisor_type=(SELECT DISTINCT host.hypervisor_type from host where host.cluster_id = cluster.id GROUP BY host.hypervisor_type);
UPDATE `cloud`.`cluster` SET hypervisor_type=(SELECT DISTINCT host.hypervisor_type from host where host.cluster_id = cluster.id GROUP BY host.hypervisor_type);

ALTER TABLE `cloud`.`volumes` ADD COLUMN `attached` datetime;
UPDATE `cloud`.`volumes` SET attached=now() WHERE removed IS NULL AND instance_id IS NOT NULL;
Expand All @@ -286,7 +286,7 @@ ALTER TABLE `cloud`.`vlan` ADD COLUMN `network_id` bigint unsigned NOT NULL;

ALTER TABLE `cloud`.`data_center` ADD COLUMN `domain` varchar(100);
ALTER TABLE `cloud`.`data_center` ADD COLUMN `domain_id` bigint unsigned;
ALTER TABLE `cloud`.`data_center` ADD COLUMN `networktype` varchar(255) NOT NULL DEFAULT 'Basic';
ALTER TABLE `cloud`.`data_center` ADD COLUMN `networktype` varchar(255) NOT NULL DEFAULT 'Basic';
ALTER TABLE `cloud`.`data_center` ADD COLUMN `dns_provider` char(64) DEFAULT 'VirtualRouter';
ALTER TABLE `cloud`.`data_center` ADD COLUMN `gateway_provider` char(64) DEFAULT 'VirtualRouter';
ALTER TABLE `cloud`.`data_center` ADD COLUMN `firewall_provider` char(64) DEFAULT 'VirtualRouter';
Expand All @@ -306,7 +306,7 @@ UPDATE `cloud`.`op_dc_link_local_ip_address_alloc` SET reservation_id=concat(cas
ALTER TABLE `cloud`.`host_pod_ref` ADD COLUMN `enabled` tinyint NOT NULL DEFAULT 1;

ALTER TABLE `cloud`.`op_dc_vnet_alloc` ADD COLUMN `reservation_id` char(40) NULL;
UPDATE op_dc_vnet_alloc set reservation_id=concat(cast(data_center_id as CHAR), concat("-", vnet)) WHERE taken is NOT NULL;
UPDATE op_dc_vnet_alloc set reservation_id=concat(cast(data_center_id as CHAR), concat("-", vnet)) WHERE taken is NOT NULL;

ALTER TABLE `cloud`.`vm_instance` ADD COLUMN `service_offering_id` bigint unsigned NOT NULL;
ALTER TABLE `cloud`.`vm_instance` ADD COLUMN `reservation_id` char(40);
Expand All @@ -326,7 +326,7 @@ ALTER TABLE `cloud`.`user_vm` ADD COLUMN `display_name` varchar(255);
UPDATE user_vm inner join vm_instance on user_vm.id=vm_instance.id set user_vm.iso_id=vm_instance.iso_id, user_vm.display_name=vm_instance.display_name where vm_instance.type='User';

ALTER TABLE `cloud`.`template_host_ref` ADD COLUMN `physical_size` bigint unsigned DEFAULT 0;
UPDATE template_host_ref INNER JOIN template_spool_ref ON template_host_ref.template_id=template_spool_ref.template_id SET template_host_ref.physical_size=template_spool_ref.template_size;
UPDATE template_host_ref INNER JOIN template_spool_ref ON template_host_ref.template_id=template_spool_ref.template_id SET template_host_ref.physical_size=template_spool_ref.template_size;


CREATE TABLE `cloud`.`user_vm_details` (
Expand Down Expand Up @@ -412,7 +412,7 @@ CREATE TABLE `cloud`.`vpn_users` (
CONSTRAINT `fk_vpn_users__owner_id` FOREIGN KEY (`owner_id`) REFERENCES `account`(`id`) ON DELETE CASCADE,
CONSTRAINT `fk_vpn_users__domain_id` FOREIGN KEY (`domain_id`) REFERENCES `domain`(`id`) ON DELETE CASCADE,
INDEX `i_vpn_users_username`(`username`),
UNIQUE `i_vpn_users__account_id__username`(`owner_id`, `username`)
UNIQUE `i_vpn_users__account_id__username`(`owner_id`, `username`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8;

ALTER TABLE `cloud`.`storage_pool` ADD COLUMN `status` varchar(32);
Expand Down Expand Up @@ -490,7 +490,7 @@ CREATE TABLE `cloud`.`usage_event` (
`resource_name` varchar(255),
`offering_id` bigint unsigned,
`template_id` bigint unsigned,
`size` bigint unsigned,
`size` bigint unsigned,
`processed` tinyint NOT NULL default '0',
PRIMARY KEY (`id`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -5,9 +5,9 @@
-- to you under the Apache License, Version 2.0 (the
-- "License"); you may not use this file except in compliance
-- with the License. You may obtain a copy of the License at
--
--
-- http://www.apache.org/licenses/LICENSE-2.0
--
--
-- Unless required by applicable law or agreed to in writing,
-- software distributed under the License is distributed on an
-- "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -5,9 +5,9 @@
-- to you under the Apache License, Version 2.0 (the
-- "License"); you may not use this file except in compliance
-- with the License. You may obtain a copy of the License at
--
--
-- http://www.apache.org/licenses/LICENSE-2.0
--
--
-- Unless required by applicable law or agreed to in writing,
-- software distributed under the License is distributed on an
-- "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -5,9 +5,9 @@
-- to you under the Apache License, Version 2.0 (the
-- "License"); you may not use this file except in compliance
-- with the License. You may obtain a copy of the License at
--
--
-- http://www.apache.org/licenses/LICENSE-2.0
--
--
-- Unless required by applicable law or agreed to in writing,
-- software distributed under the License is distributed on an
-- "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -5,9 +5,9 @@
-- to you under the Apache License, Version 2.0 (the
-- "License"); you may not use this file except in compliance
-- with the License. You may obtain a copy of the License at
--
--
-- http://www.apache.org/licenses/LICENSE-2.0
--
--
-- Unless required by applicable law or agreed to in writing,
-- software distributed under the License is distributed on an
-- "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -5,9 +5,9 @@
-- to you under the Apache License, Version 2.0 (the
-- "License"); you may not use this file except in compliance
-- with the License. You may obtain a copy of the License at
--
--
-- http://www.apache.org/licenses/LICENSE-2.0
--
--
-- Unless required by applicable law or agreed to in writing,
-- software distributed under the License is distributed on an
-- "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
Expand All @@ -29,7 +29,7 @@ CREATE TABLE `cloud`.`mshost_peer` (
`peer_runid` bigint NOT NULL,
`peer_state` varchar(10) NOT NULL DEFAULT 'Down',
`last_update` DATETIME NULL COMMENT 'Last record update time',

PRIMARY KEY (`id`),
CONSTRAINT `fk_mshost_peer__owner_mshost` FOREIGN KEY (`owner_mshost`) REFERENCES `mshost`(`id`) ON DELETE CASCADE,
CONSTRAINT `fk_mshost_peer__peer_mshost` FOREIGN KEY (`peer_mshost`) REFERENCES `mshost`(`id`),
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -5,9 +5,9 @@
-- to you under the Apache License, Version 2.0 (the
-- "License"); you may not use this file except in compliance
-- with the License. You may obtain a copy of the License at
--
--
-- http://www.apache.org/licenses/LICENSE-2.0
--
--
-- Unless required by applicable law or agreed to in writing,
-- software distributed under the License is distributed on an
-- "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
Expand All @@ -22,7 +22,7 @@ ALTER TABLE `cloud_usage`.`usage_network` DROP COLUMN `current_bytes_sent`;

ALTER TABLE `cloud`.`template_host_ref` DROP COLUMN `pool_id`;
DELETE from `cloud`.`op_host_capacity` where capacity_type in (2,4,6);
ALTER TABLE `cloud`.`vm_instance` DROP COLUMN `private_netmask`;
ALTER TABLE `cloud`.`vm_instance` DROP COLUMN `private_netmask`;

ALTER TABLE `cloud`.`security_group_rule` drop foreign key `fk_security_ingress_rule___security_group_id`;
ALTER TABLE `cloud`.`security_group_rule` drop foreign key `fk_security_ingress_rule___allowed_network_id`;
Expand Down
Loading

0 comments on commit 9f1577d

Please sign in to comment.