diff --git a/tabcmd/commands/datasources_and_workbooks/publish_command.py b/tabcmd/commands/datasources_and_workbooks/publish_command.py index 1dd2bfc1..dfd26b28 100644 --- a/tabcmd/commands/datasources_and_workbooks/publish_command.py +++ b/tabcmd/commands/datasources_and_workbooks/publish_command.py @@ -69,11 +69,13 @@ def run_command(cls, args): if args.db_username: creds = TSC.models.ConnectionCredentials(args.db_username, args.db_password, embed=args.save_db_password) workbook_connections = TSC.ConnectionItem() + workbook_connections.server_address = args.db_server workbook_connections.connection_credentials = creds datasource_credentials = creds elif args.oauth_username: creds = TSC.models.ConnectionCredentials(args.oauth_username, None, embed=False, oauth=args.save_oauth) workbook_connections = TSC.ConnectionItem() + workbook_connections.server_address = args.db_server workbook_connections.connection_credentials = creds datasource_credentials = creds else: @@ -183,7 +185,7 @@ def publish_workbook_file(args, logger, server, project_id, str_filename, publis publish_mode, # args.thumbnail_username, not yet implemented in tsc # args.thumbnail_group, - connections=credentials, + connections=[credentials] if credentials else None, as_job=False, skip_connection_check=args.skip_connection_check, ) diff --git a/tabcmd/execution/global_options.py b/tabcmd/execution/global_options.py index 1a24133c..142aed58 100644 --- a/tabcmd/execution/global_options.py +++ b/tabcmd/execution/global_options.py @@ -258,6 +258,7 @@ def set_publish_args(parser): creds.add_argument("--db-username", help=_("publish.options.db-username")) parser.add_argument("--save-oauth", action="store_true", help=_("publish.options.save-oauth")) + parser.add_argument("--db-server", help=_("publish.options.db-server")) parser.add_argument("--db-password", help=_("publish.options.db-password")) parser.add_argument("--save-db-password", action="store_true", help=_("publish.options.save-db-password")) diff --git a/tabcmd/locales/de/LC_MESSAGES/tabcmd.mo b/tabcmd/locales/de/LC_MESSAGES/tabcmd.mo index cac49e59..91b71d3f 100644 Binary files a/tabcmd/locales/de/LC_MESSAGES/tabcmd.mo and b/tabcmd/locales/de/LC_MESSAGES/tabcmd.mo differ diff --git a/tabcmd/locales/de/tabcmd_messages_de.properties b/tabcmd/locales/de/tabcmd_messages_de.properties index 399e44d0..0faed37e 100644 --- a/tabcmd/locales/de/tabcmd_messages_de.properties +++ b/tabcmd/locales/de/tabcmd_messages_de.properties @@ -77,6 +77,7 @@ publish.errors.unexpected_server_response=Unerwartete Antwort vom Server: {0} publish.errors.server_resource_not_found=Die von Ihnen angegebene Ressource exisitiert nicht oder Sie haben nicht die Berechtigung, sie einzusehen. Prüfen Sie Ihren Projektnamen und Ihre Berechtigungen. publish.options.append=Extraktdatei an vorhandene Datenquelle anfügen publish.options.db-password=Datenbankkennwort für alle Datenquellen +publish.options.db-server=Serveradresse der Datenbank, die den eingebetteten Verbindungsanmeldeinformationen zugeordnet werden soll. Erforderlich bei Verwendung von --db-username oder --oauth-username zum Veröffentlichen einer Arbeitsmappe. publish.options.db-username=Datenbankbenutzername für alle Datenquellen publish.options.encrypt_extracts=Extrakte auf dem Server verschlüsseln publish.options.name=Arbeitsmappen-/Datenquellenname auf dem Server. Wenn keine Angabe erfolgt, wird die Arbeitsmappe/Datenquelle nach dem Dateinamen ohne die Erweiterung twb(x), tds(x) oder tde benannt. Durch das Veröffentlichen einer .tde-Datei wird eine Datenquelle erstellt diff --git a/tabcmd/locales/en/tabcmd_messages_en.properties b/tabcmd/locales/en/tabcmd_messages_en.properties index 7eda4bff..e5274230 100644 --- a/tabcmd/locales/en/tabcmd_messages_en.properties +++ b/tabcmd/locales/en/tabcmd_messages_en.properties @@ -77,6 +77,7 @@ publish.errors.unexpected_server_response=Unexpected response from the server: { publish.errors.server_resource_not_found=The resource you specified does not exist, or you do not have permission to see it. Check your project name and permissions publish.options.append=Append extract file to existing data source publish.options.db-password=Database password for all data sources +publish.options.db-server=Server address of the database to associate with the embedded connection credentials. Required when using --db-username or --oauth-username to publish a workbook. publish.options.db-username=Database username for all data sources publish.options.encrypt_extracts=Encrypt extracts in the workbook or datasource being published to the server. publish.options.name=Workbook or data source name on the server. If omitted, the workbook or data source will be named after the file name, without the twb(x), tds(x), or tde extension. Publishing a .tde file will create a data source diff --git a/tabcmd/locales/es/LC_MESSAGES/tabcmd.mo b/tabcmd/locales/es/LC_MESSAGES/tabcmd.mo index db1cd9b8..fdbbd2bf 100644 Binary files a/tabcmd/locales/es/LC_MESSAGES/tabcmd.mo and b/tabcmd/locales/es/LC_MESSAGES/tabcmd.mo differ diff --git a/tabcmd/locales/es/tabcmd_messages_es.properties b/tabcmd/locales/es/tabcmd_messages_es.properties index e832ed73..78a747af 100644 --- a/tabcmd/locales/es/tabcmd_messages_es.properties +++ b/tabcmd/locales/es/tabcmd_messages_es.properties @@ -77,6 +77,7 @@ publish.errors.unexpected_server_response=Respuesta inesperada del servidor: {0} publish.errors.server_resource_not_found=El recurso que ha especificado no existe o no tiene permiso para verlo. Compruebe el nombre del proyecto y sus permisos publish.options.append=Adjuntar archivo de extracción a fuente de datos existente publish.options.db-password=Contraseña de base de datos para todas las fuentes de datos +publish.options.db-server=Dirección del servidor de la base de datos que se asociará con las credenciales de conexión incrustadas. Obligatorio cuando se usa --db-username o --oauth-username para publicar un libro de trabajo. publish.options.db-username=Nombre de usuario de base de datos para todas las fuentes de datos publish.options.encrypt_extracts=Cifrar extracciones en el servidor publish.options.name=Nombre del libro de trabajo o la fuente de datos en el servidor. Si se omite, el libro de trabajo o la fuente de datos recibirá un nombre tras el nombre de archivo, sin la extensión twb(x), tds(x) o tde. La publicación de un archivo .tde dará lugar a la creación de una fuente de datos diff --git a/tabcmd/locales/fr/LC_MESSAGES/tabcmd.mo b/tabcmd/locales/fr/LC_MESSAGES/tabcmd.mo index 70813c35..7a160340 100644 Binary files a/tabcmd/locales/fr/LC_MESSAGES/tabcmd.mo and b/tabcmd/locales/fr/LC_MESSAGES/tabcmd.mo differ diff --git a/tabcmd/locales/fr/tabcmd_messages_fr.properties b/tabcmd/locales/fr/tabcmd_messages_fr.properties index 4121acbb..32744778 100644 --- a/tabcmd/locales/fr/tabcmd_messages_fr.properties +++ b/tabcmd/locales/fr/tabcmd_messages_fr.properties @@ -77,6 +77,7 @@ publish.errors.unexpected_server_response=Réponse imprévue du serveur : {0} publish.errors.server_resource_not_found=La ressource spécifiée n’existe pas, ou vous n’êtes pas autorisé à la voir. Consultez le nom de votre projet et les autorisations. publish.options.append=Ajout d’un fichier d’extrait à une source de données existante publish.options.db-password=Mot de passe de base de données pour toutes les sources de données. +publish.options.db-server=Adresse du serveur de la base de données à associer aux informations d’identification de connexion intégrées. Obligatoire lors de l’utilisation de --db-username ou --oauth-username pour publier un classeur. publish.options.db-username=Nom d’utilisateur de base de données pour toutes les sources de données. publish.options.encrypt_extracts=Crypter les extraits sur le serveur publish.options.name=Nom du classeur/de la source de données sur le serveur. S’il est omis, le classeur/la source de données prend le nom du fichier sans l’extension twb(x), tds(x) ou tde. La publication d’un fichier .tde crée une source de données diff --git a/tabcmd/locales/ga/LC_MESSAGES/tabcmd.mo b/tabcmd/locales/ga/LC_MESSAGES/tabcmd.mo index ecc45de2..27474b6b 100644 Binary files a/tabcmd/locales/ga/LC_MESSAGES/tabcmd.mo and b/tabcmd/locales/ga/LC_MESSAGES/tabcmd.mo differ diff --git a/tabcmd/locales/ga/tabcmd_messages_ga.properties b/tabcmd/locales/ga/tabcmd_messages_ga.properties index cbcff215..320638ea 100644 --- a/tabcmd/locales/ga/tabcmd_messages_ga.properties +++ b/tabcmd/locales/ga/tabcmd_messages_ga.properties @@ -77,6 +77,7 @@ publish.errors.unexpected_server_response=dbf6-表:Unexpected response from the publish.errors.server_resource_not_found=b7e8-表:The resource you specified does not exist, or you do not have permission to see it. Check your project name and permissions|桜 publish.options.append=6393-表:Append extract file to existing data source|桜 publish.options.db-password=ab47-表:Database password for all data sources|桜 +publish.options.db-server=3166-表:Server address of the database to associate with the embedded connection credentials. Required when using --db-username or --oauth-username to publish a workbook.|桜 publish.options.db-username=139f-表:Database username for all data sources|桜 publish.options.encrypt_extracts=cfbc-表:Encrypt extracts on the server|桜 publish.options.name=b1bc-表:Workbook/data source name on the server. If omitted, the workbook/data source will be named after the file name, without the twb(x), tds(x), or tde extension. Publishing a .tde file will create a data source|桜 diff --git a/tabcmd/locales/it/LC_MESSAGES/tabcmd.mo b/tabcmd/locales/it/LC_MESSAGES/tabcmd.mo index 50a2e9f7..3535bc68 100644 Binary files a/tabcmd/locales/it/LC_MESSAGES/tabcmd.mo and b/tabcmd/locales/it/LC_MESSAGES/tabcmd.mo differ diff --git a/tabcmd/locales/it/tabcmd_messages_it.properties b/tabcmd/locales/it/tabcmd_messages_it.properties index 02ce5f78..e31ef9b8 100644 --- a/tabcmd/locales/it/tabcmd_messages_it.properties +++ b/tabcmd/locales/it/tabcmd_messages_it.properties @@ -77,6 +77,7 @@ publish.errors.unexpected_server_response=Risposta inaspettata dal server: {0} publish.errors.server_resource_not_found=La risorsa specificata non esiste o non si ha l’autorizzazione a visualizzarla. Controlla il nome del progetto e le autorizzazioni publish.options.append=Aggiungi un file di estrazione all’origine dati esistente publish.options.db-password=Password del database per tutte le origini dati +publish.options.db-server=Indirizzo del server del database da associare alle credenziali di connessione incorporate. Obbligatorio quando si usa --db-username o --oauth-username per pubblicare una cartella di lavoro. publish.options.db-username=Nome utente del database per tutte le origini dati publish.options.encrypt_extracts=Crittografare le estrazioni su un server publish.options.name=Cartella di lavoro/nome dell’origine dati sul server. Se omessa, la cartella di lavoro/origine dati sarà rinominata secondo il nome del file, senza l’estensione twb(x), tds(x) o tde. La pubblicazione di un file .tde creerà un’origine dati diff --git a/tabcmd/locales/ja/LC_MESSAGES/tabcmd.mo b/tabcmd/locales/ja/LC_MESSAGES/tabcmd.mo index ce6b79fa..7d06038c 100644 Binary files a/tabcmd/locales/ja/LC_MESSAGES/tabcmd.mo and b/tabcmd/locales/ja/LC_MESSAGES/tabcmd.mo differ diff --git a/tabcmd/locales/ja/tabcmd_messages_ja.properties b/tabcmd/locales/ja/tabcmd_messages_ja.properties index 28f1b0b9..27c911a2 100644 --- a/tabcmd/locales/ja/tabcmd_messages_ja.properties +++ b/tabcmd/locales/ja/tabcmd_messages_ja.properties @@ -77,6 +77,7 @@ publish.errors.unexpected_server_response=サーバーからの予期しない publish.errors.server_resource_not_found=指定されたリソースは存在しないか、そのリソースを表示できるパーミッションがありません。プロジェクト名とパーミッションを確認してください。 publish.options.append=抽出ファイルを既存のデータ ソースに追加 publish.options.db-password=すべてのデータ ソースのデータベース パスワード +publish.options.db-server=埋め込まれた接続資格情報に関連付けるデータベースのサーバー アドレス。ワークブックの発行時に --db-username または --oauth-username を使用する場合は必須です。 publish.options.db-username=すべてのデータ ソースのデータベース ユーザー名 publish.options.encrypt_extracts=サーバーで抽出を暗号化する publish.options.name=サーバー上のワークブック/データ ソース名。省略した場合は、ファイル名から twb(x)、tds(x)、または tde 拡張子を除いた名前に従ってワークブック/データ ソースの名前が付けられます。.tde ファイルをパブリッシュすると、データ ソースが作成されます diff --git a/tabcmd/locales/ko/LC_MESSAGES/tabcmd.mo b/tabcmd/locales/ko/LC_MESSAGES/tabcmd.mo index 0b1ea7d1..54c8d41c 100644 Binary files a/tabcmd/locales/ko/LC_MESSAGES/tabcmd.mo and b/tabcmd/locales/ko/LC_MESSAGES/tabcmd.mo differ diff --git a/tabcmd/locales/ko/tabcmd_messages_ko.properties b/tabcmd/locales/ko/tabcmd_messages_ko.properties index 23608130..3a764340 100644 --- a/tabcmd/locales/ko/tabcmd_messages_ko.properties +++ b/tabcmd/locales/ko/tabcmd_messages_ko.properties @@ -77,6 +77,7 @@ publish.errors.unexpected_server_response=서버의 예기치 않은 응답: {0} publish.errors.server_resource_not_found=지정한 리소스가 존재하지 않거나 사용자에게 리소스를 볼 수 있는 권한이 없습니다. 프로젝트 이름 및 사용 권한을 확인하십시오. publish.options.append=기존 데이터 원본에 추출 파일 추가 publish.options.db-password=모든 데이터 원본에 대한 데이터베이스 비밀번호 +publish.options.db-server=포함된 연결 자격 증명과 연결할 데이터베이스의 서버 주소입니다. 워크북을 게시할 때 --db-username 또는 --oauth-username을 사용하는 경우 필수입니다. publish.options.db-username=모든 데이터 원본에 대한 데이터베이스 사용자 이름 publish.options.encrypt_extracts=서버에서 추출 암호화 publish.options.name=서버에 있는 통합 문서/데이터 원본 이름입니다. 생략된 경우 통합 문서/데이터 원본의 이름은 twb(x), tds(x) 또는 tde 확장명을 제외한 파일 이름으로 지정됩니다. .tde 파일을 게시하면 데이터 원본이 만들어집니다. diff --git a/tabcmd/locales/pt/LC_MESSAGES/tabcmd.mo b/tabcmd/locales/pt/LC_MESSAGES/tabcmd.mo index fa709d8a..2b6036af 100644 Binary files a/tabcmd/locales/pt/LC_MESSAGES/tabcmd.mo and b/tabcmd/locales/pt/LC_MESSAGES/tabcmd.mo differ diff --git a/tabcmd/locales/pt/tabcmd_messages_pt.properties b/tabcmd/locales/pt/tabcmd_messages_pt.properties index 32427c37..c9dbfddd 100644 --- a/tabcmd/locales/pt/tabcmd_messages_pt.properties +++ b/tabcmd/locales/pt/tabcmd_messages_pt.properties @@ -77,6 +77,7 @@ publish.errors.unexpected_server_response=Resposta inesperada do servidor: {0} publish.errors.server_resource_not_found=O recurso especificado não existe ou você não tem permissão para vê-lo. Verifique o nome e as permissões do projeto publish.options.append=Anexe o arquivo de extração à fonte de dados existente publish.options.db-password=Senha do banco de dados para todas as fontes de dados +publish.options.db-server=Endereço do servidor do banco de dado associado as credenciais. Obrigatório ao usar --db-username ou --oauth-username. publish.options.db-username=Nome de usuário do banco de dados para todas as fontes de dados publish.options.encrypt_extracts=Criptografar extrações no servidor publish.options.name=O nome da pasta de trabalho/fonte de dados no servidor. Se omitido, a pasta de trabalho/fonte de dados será nomeado de acordo com nome de arquivo, sem a extensão twb(x), tds(x) ou tde. Publicar um arquivo .tde criará uma fonte de dados diff --git a/tabcmd/locales/sv/LC_MESSAGES/tabcmd.mo b/tabcmd/locales/sv/LC_MESSAGES/tabcmd.mo index e329a6a8..d854d2f1 100644 Binary files a/tabcmd/locales/sv/LC_MESSAGES/tabcmd.mo and b/tabcmd/locales/sv/LC_MESSAGES/tabcmd.mo differ diff --git a/tabcmd/locales/sv/tabcmd_messages_sv.properties b/tabcmd/locales/sv/tabcmd_messages_sv.properties index 448381a7..ccf9ea64 100644 --- a/tabcmd/locales/sv/tabcmd_messages_sv.properties +++ b/tabcmd/locales/sv/tabcmd_messages_sv.properties @@ -77,6 +77,7 @@ publish.errors.unexpected_server_response=Oväntat svar från servern: {0} publish.errors.server_resource_not_found=Den resurs du angav finns inte, eller så har du inte behörighet att se den. Kontrollera ditt projektnamn och dina behörigheter publish.options.append=Lägg till extraktfil till befintlig datakälla publish.options.db-password=Databaslösenord för alla datakällor +publish.options.db-server=Serveradress för databasen som ska associeras med de inbäddade anslutningsuppgifterna. Krävs när --db-username eller --oauth-username används för att publicera en arbetsbok. publish.options.db-username=Databasanvändarnamn för alla datakällor publish.options.encrypt_extracts=Kryptera extrakt på servern publish.options.name=Arbetsbokens/datakällans namn på servern. Om det inte anges namnges arbetsboken/datakällan efter filnamnet, utan filnamnstillägget twb(x), tds(x) eller tde. Om du publicerar en .tde-fil skapas en datakälla diff --git a/tabcmd/locales/zh/LC_MESSAGES/tabcmd.mo b/tabcmd/locales/zh/LC_MESSAGES/tabcmd.mo index 3c252067..c9d0e60f 100644 Binary files a/tabcmd/locales/zh/LC_MESSAGES/tabcmd.mo and b/tabcmd/locales/zh/LC_MESSAGES/tabcmd.mo differ diff --git a/tabcmd/locales/zh/tabcmd_messages_zh.properties b/tabcmd/locales/zh/tabcmd_messages_zh.properties index 58beb33a..8a1d0825 100644 --- a/tabcmd/locales/zh/tabcmd_messages_zh.properties +++ b/tabcmd/locales/zh/tabcmd_messages_zh.properties @@ -77,6 +77,7 @@ publish.errors.unexpected_server_response=来自服务器的意外响应: {0} publish.errors.server_resource_not_found=指定的资源不存在,或者您没有查看该资源的权限。请检查您的项目名称和权限 publish.options.append=将数据提取文件追加到现有数据源 publish.options.db-password=用于所有数据源的数据库密码 +publish.options.db-server=要与嵌入式连接凭据关联的数据库的服务器地址。使用 --db-username 或 --oauth-username 发布工作簿时必需。 publish.options.db-username=用于所有数据源的数据库用户名 publish.options.encrypt_extracts=在服务器上对数据提取进行加密 publish.options.name=服务器上的工作簿/数据源名称。如果省略,将使用文件名作为工作簿/数据源名称(无 twb(x)、tds(x) 或 tde 扩展名)。发布 .tde 文件将会创建数据源 diff --git a/tests/commands/test_publish_command.py b/tests/commands/test_publish_command.py index 368fd997..df4b7115 100644 --- a/tests/commands/test_publish_command.py +++ b/tests/commands/test_publish_command.py @@ -55,6 +55,7 @@ def test_publish_with_creds(self, mock_path, mock_glob, mock_session): mock_args.db_username = "username" mock_args.db_password = "oauth_u" + mock_args.db_server = "db.example.com" mock_args.save_db_password = True mock_args.oauth_username = None mock_args.embed = False @@ -66,6 +67,44 @@ def test_publish_with_creds(self, mock_path, mock_glob, mock_session): PublishCommand.run_command(mock_args) mock_session.internal_server.workbooks.publish.assert_called() + call_kwargs = mock_session.internal_server.workbooks.publish.call_args.kwargs + connections = call_kwargs["connections"] + self.assertEqual(len(connections), 1) + self.assertEqual(connections[0].server_address, "db.example.com") + + def test_publish_with_creds_no_db_server(self, mock_path, mock_glob, mock_session): + set_up_mock_server(mock_session) + mock_path = set_up_mock_path(mock_path) + + mock_args.overwrite = False + mock_args.append = True + mock_args.replace = False + + mock_args.filename = "existing_file.twbx" + mock_args.project_name = "project-name" + mock_args.parent_project_path = "projects" + mock_args.name = "" + mock_args.tabbed = True + + mock_args.db_username = "username" + mock_args.db_password = "oauth_u" + mock_args.db_server = None + mock_args.save_db_password = True + mock_args.oauth_username = None + mock_args.embed = False + + mock_args.thumbnail_username = None + mock_args.thumbnail_group = None + mock_args.skip_connection_check = False + + PublishCommand.run_command(mock_args) + mock_session.internal_server.workbooks.publish.assert_called() + + call_kwargs = mock_session.internal_server.workbooks.publish.call_args.kwargs + connections = call_kwargs["connections"] + self.assertEqual(len(connections), 1) + self.assertIsNone(connections[0].server_address) + def test_get_files_to_publish_twbx(self, mock_path, mock_glob, mock_session): set_up_mock_server(mock_session) mock_path = set_up_mock_path(mock_path)