Skip to content

Conversation

@muralinimmagadda
Copy link
Contributor

Pull request checklist

Please check if your PR fulfills the following requirements:

  • Tests for the changes have been added (for bug fixes / features)
  • Docs have been reviewed and added / updated if needed (for bug fixes / features)
  • Build was run locally and any changes were pushed
  • Lint has passed locally and any fixes were made for failures

Pull request type

Please check the type of change your PR introduces:

  • Bugfix
  • Feature
  • Code style update (formatting, renaming)
  • Refactoring (no functional changes, no api changes)
  • Build related changes
  • Documentation content changes
  • Other (please describe):

What is the current behavior?

dvp init -s staged fails on windows

Issue Number: 96

What is the new behavior?

dvp init -s staged successful on windows

Does this introduce a breaking change?

  • Yes
  • No

Other information

@muralinimmagadda
Copy link
Contributor Author

dvp init -s STAGED is failing with following error.

File "c:\murali\venv\lib\site-packages\click\types.py", line 187, in convert
normed_value = lower(normed_value)
TypeError: descriptor 'lower' requires a 'str' object but received a 'unicode'

The error is thrown at line 187 of the below file and looks like a bug in click 7.1 code. https://github.com/pallets/click/blob/7.x/src/click/types.py

The problem is in this part of their code where normed_value is a unicode value and they are calling str.lower() on it.

def convert(self, value, param, ctx):
# Match through normalization and case sensitivity
# first do token_normalize_func, then lowercase
# preserve original value to produce an accurate message in
# self.fail
normed_value = value
normed_choices = {choice: choice for choice in self.choices}

    if ctx is not None and ctx.token_normalize_func is not None:
        normed_value = ctx.token_normalize_func(value)
        normed_choices = {
            ctx.token_normalize_func(normed_choice): original
            for normed_choice, original in normed_choices.items()
        }

    if not self.case_sensitive:
        if PY2:
            lower = str.lower
        else:
            lower = str.casefold

        normed_value = lower(normed_value)
        normed_choices = {
            lower(normed_choice): original
            for normed_choice, original in normed_choices.items()
        }

Removing case_sensitive=False on init method of cli.py can bypass this but it introduces the change of behaviour for -s staged vs -s STAGED. So, instead of changing this, i added token_normalize_func() that converts unicode to a string type so that normed_value = ctx.token_normalize_func(value) can modify it to a string type before the call to lower() that was failing this happens.

ankursarin
ankursarin previously approved these changes Apr 22, 2020
Copy link
Contributor

@ankursarin ankursarin left a comment

Choose a reason for hiding this comment

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

looks good. ship it!

@muralinimmagadda muralinimmagadda self-assigned this Apr 22, 2020
@muralinimmagadda muralinimmagadda linked an issue Apr 22, 2020 that may be closed by this pull request
@muralinimmagadda
Copy link
Contributor Author

@zach-burke ran blackbox tests with the fix : http://selfservice.jenkins.delphix.com/job/devops-gate/job/master/job/blackbox-self-service/34202/consoleFull

The failures are not related to this fix. so we are good to go.

@muralinimmagadda muralinimmagadda merged commit e140b5a into delphix:develop Apr 24, 2020
@muralinimmagadda muralinimmagadda deleted the dvp-init-windows branch April 24, 2020 20:18
fdrozdowski added a commit that referenced this pull request May 8, 2020
* Initial push

* Add initial References

* Add first pages to the First Plugin section

* Add ingestion page

* Add decorators and standardize Schemas and Autogenerated Classes

* Add info on provisioning

* Add Decorators and update documentation

* JSON schemas

* Add Intro Section

* Move schema, references, autogenerated classes sections

* Standardize json highlighting

* Finished Schemas and Autogenerated Classes

* Fixed some inconsistencies in the References

* Add JSON schema summaries

* Add info about sensitive data

* Add partial info on versioning

* Add logging reference page

* Remove site/ from the repository since it contains the build

* All Plugin Operations done

* Update decorators to new naming scheme

* Add all classes

* Update imports for Plugin Operations

* Standardize arguments for plugin operations

* Add sample workflows

* Fix legend

* Add first draft of Getting Started and CLI reference docs

* Update discovery

* Add images for all workflows

* Add Delphix Libraries

* Make Reference pages consistent

* Make Reference pages consistent (remove dlpx)

* Update Workflows based on feedback

* nits

* nits

* Stephen's comments

* Update minor wording and layout in CLI docs

* updated welcome page per Stephen

* Few minor edits to the page.

* Editing overview page.

* Editing Initial_Setup page.

* Edited Discovery page.

* Add optional/required plugin operations

* Edited Data_Ingestion page

* Switch Plugin Operation Columns, highlight

* Fixed numbering issue

* Added page for managing scripts for remote execution

* Edits to data Ingestion and Provisioning pages.

* Fixing numbering issue.

* Indicate required vs optionsal plugin operations

* Edits to best practices section.

* Add full example to managing scripts section and a common issue to Getting Started

* Fixed note.

* Update .hooksconfig

* Fix examples and change note types

* Update copyright to 2019

* Add Feature Flag instructions

* Update required vs optional plugin operations

* Fix some admonitions, copy edits

* Modify logging documents to change the old naming format to new format

* Update logging with examples

* Update Sensitive Data to be consistent with run_bash

* Fix a broken link in plugin operations

* Update code samples after getting intro plugin fully working

* Add survey links, edit pages for consistency

* Make "Survey" links

* Fix command in inital setup and add to script execution

* Add reference for the plugin config file

* initial plugin code changes

* Update for Python naming conventions

* Fix import in Discovery

* Change description of `log_info` writes to `info.log` and `info.log` to `log_info` writes to `info.log` and `debug.log`.

* Move warnings about argument names

* Update Virtual Source Enable Workflow to include Status

* Fix VirtualSourceEnable workflow

* Fix Mount class attributes

* Change the word Toolkit to Plugin to match the new standard.

* Changing colors to new UX color scheme used in other docs

* Added gitignore and modified build.sh

* Fix Virtual Source Status parameters

* Fix linked.status() decorator

* Fixing some basic typos/mistakes

* Update VirtualSource to add the mounts attribute

* Remove TODOs, copy edits

* Updated logging page

* Fix broken links on Welcome page

* Adding .md extension to links on index.md to fix directory routing in S3

* Fix Data Ingestion link

* Fix broken links

* Update Logging format for plugin logs

* Update Logging format for plugin logs

* Update examples for logging

* PYT-434 "Basic Usage" and "Enable the Delphix Engine Feature Flag" subsections should be flipped in the docs

* Add Java requirement to Getting Started page

* Run_bash does not explain clearly how to send the arguments to the command

* Initial draft of Release Notes

* Update 0.4.0 release notes

* Address comments for the release notes

* PYT-480 Add documentation for dvp download-logs

* PYT-417 need to add snapshot_parameters to the docs for staged pre and post snapshot
PYT-476 SDK docs - Platform Library run_sync docs missing
PYT-494 Updated SDK docs to include "staged_connection" and "source_connection" in StagedSource

Reviewed at: http://reviews.delphix.com/r/49531/

* PYT-505 Fix all doc links to use the same format and fix any broken links

Reviewed at: http://reviews.delphix.com/r/49538/

* Completed Release Notes and all related changes

* Remove white spaces in Release notes

* Add code sharing documentation

* Docs editing for beta

Reviewed at: http://reviews.delphix.com/r/49545/

* Fix beta typos

* Edits for Beta

* Update code sharing

* Change PyPI link to point to dvp project

* Change Release Note titles

* Add upgrade instructions to the release notes

* doc changes to include run_expect reponse

* PYT-432 Add Powershell exit code section

* PYT-636 Fix Documentation for PYT-536 and PYT-537

Reviewed at: http://reviews.delphix.com/r/50794/

* Update Getting Started for GA

* fix indentation issue in logging examples

* PYT-15 GA: Update the "your first plugin" docs to match GA code.

* Fix inconsistencies in Code Sharing

* PYT-638 Write Documentation on limitations of swagger generated classes

Reviewed at: http://reviews.delphix.com/r/50885/

* PYT-658 GA: Update the docs with manuals on how to write config files for dvp

Reviewed at: http://reviews.delphix.com/r/51210/

* PYT-602 Document details about UserError that can be raised by plugin author
PYT-603 Add documentation for using unicode in run_bash

Reviewed at: http://reviews.delphix.com/r/51163/

* PYT-706 Document new plugin classes RemoteConnection, RemoteEnvironment, RemoteUser, RemoteHost

Reviewed at: http://reviews.delphix.com/r/51522/

* PYT-728 Release Notes for GA

Reviewed at: http://reviews.delphix.com/r/51558/

* PYT-730 Documentation Cleanup for GA

Reviewed at: http://reviews.delphix.com/r/51598/

* DOC-313 Add current version number to site title for virt-sdk-docs

Reviewed at: http://reviews.delphix.com/r/51678/

* PYT-742 update docs for pyt-357

Reviewed at: http://reviews.delphix.com/r/52996/

* PYT-884 Update plugin docs to inform plugin writers of required parameter changes in the Mount object

* Update .hooksconfig

* Update .hooksconfig

* Remove bad info from readme

Reviewed at: http://reviews.delphix.com/r/53919/

* PYT-1036 Documentation should include example of required properties

Reviewed at: http://reviews.delphix.com/r/54910/

* PYT-981 Document what to do when migrations are not sufficient (text)
PYT-984 Documentation for plugin backporting (text)

Reviewed at: http://reviews.delphix.com/r/55505/

* PYT-981 Document what to do when migrations are not sufficient (text) (revert)
PYT-984 Documentation for plugin backporting (text) (revert)

* PYT-1248 Merge plugin upgrade docs into master VSDK docs

Reviewed at: http://reviews.delphix.com/r/57181/

* PYT-1274 Comment out any TODOs in the Virtualization SDK docs

Reviewed at: http://reviews.delphix.com/r/57651/

* PYT-1275 Add upgrade workflow to virtualization SDK docs

Reviewed at: http://reviews.delphix.com/r/57744/

* PYT-868 Lua to Python - Change plugin config to expect optional lua n… (#98)

* PYT-868 Lua to Python - Change plugin config to expect optional lua name field

* PYT-1257 Document requirements for successful inactive plugin upgrade

Reviewed at: http://reviews.delphix.com/r/57705/

* Revert "PYT-868 Lua to Python - Change plugin config to expect optional lua n… (#98)" (#102)

This reverts commit 676012f.

* Fixes #96 dvp init hitting TypeError on Windows10 (#99)

* Remove hooksconfig

* Modify SDK version format to be compatible with PEP440 (#106)

* SDK 2.0.0 Docs review (fixes #100) (#109)

SDK 2.0.0 Docs review (fixes #100)

* Point the SDK to dvp-api 1.1.0 (#108)

https://pypi.org/project/dvp-api/1.1.0/

* Fix bumpversion config and bump SDK version to 2.0.0 (#112)

* Add SDK 2.0.0 Release Notes (closes #113) (#114)

Add SDK 2.0.0 Release Notes #113
closes #113

* Docs 2.0.0

Co-authored-by: Steven Karam <[email protected]>
Co-authored-by: Ankur Sarin <[email protected]>
Co-authored-by: Tom Walsh <[email protected]>
Co-authored-by: Grant Magdanz <[email protected]>
Co-authored-by: Jaspal Sumal <[email protected]>
Co-authored-by: Sriharsha kanuri <[email protected]>
Co-authored-by: zach-burke <[email protected]>
Co-authored-by: jeff ngo <[email protected]>
Co-authored-by: Lindsey Nguyen <[email protected]>
Co-authored-by: muralidhar nimmagadda <[email protected]>
Co-authored-by: Jeff Feldstein <[email protected]>
Co-authored-by: Andrea Chang <[email protected]>
Co-authored-by: Jeff Ngo <[email protected]>
Co-authored-by: Ravi Mukkamala <[email protected]>
Co-authored-by: muralinimmagadda <[email protected]>
Co-authored-by: ankursarin <[email protected]>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Development

Successfully merging this pull request may close these issues.

dvp init hitting TypeError on Windows10

6 participants